Winner of Red Gate’s: Mysteries of the .NET Framework Challenge

Revisiting and archiving on September 7, 2026.

I often used Redgate SQL Tools to manage Microsoft SQL Server databases. I used the suite of tools while working at Computer Sciences Corporation. It had many tools that I used:

  • SQL Compare: Compare two databases and create a SQL script to synchronize the second database schema with the first – great for deploying update scripts.
  • SQL Data Compare: compares data between two databases to synchronize the data between them. Great for deploying lookup tables and new entries.
  • SQL Prompt: Added code completion while writing SQL scripts.
  • SQL Data Generator: Populated a database with random and not-so-random data. Before that, I wrote my own scripts to do the same.
  • SQL Response: Monitored the health of databases and sent alerts. I used this extensively to help optimize the databases as well.
  • SQL Backup Pro: Backup database snapshots and compress them.

I was also a .NET programmer. At the time, I often used Lutz Reoder’s .NET Reflector to disassemble .NET programs after learning about it in a C# guerrilla certification program. I often used it to help convert our old VB.Net programs into C#, or at least to get a good grasp of how to do it. Red Gate had just acquired the software and also introduced a new tool to their bundle of database tools – ANTS (Advanced .NET Testing System) Profiler.

The community was divided over .NET Reflector becoming commercial software. It was a strategic move, though. Red Gate was making database software, and now they were moving into .NET with ANTS (Advanced .NET Testing System).

ANTS could identify bottlenecks, drill into your related code, find memory leaks, and profile both ASP.Net web applications and desktop software.

With the software’s introduction, they ran a contest where participants answered four questions to win a license for ANTS 4 (a $295 value), which could monitor the performance and memory of .NET applications. It was a handy tool for troubleshooting bottlenecks.

The four questions were:

  1. When processing some data into a list, is it faster to build up a collection and return it as an enumerator, or use yield to create the enumerator ‘on the fly’?
  2. What is the best approach to doing fast complex string manipulation in .NET?
  3. What are the differences between a debug and a release build in C#? How do they affect performance?
  4. When is it a good idea to start using more than one thread?

My answer placed 5th out of 8 winners and was noted for spotting some catches in the list question.

Here is my $300 answer:

October 1, 2008, 6:38 PM: Re: Mysteries of the NET Framework: Question 1

Tricky one. I suppose one benefit to having an enum on the fly is that dependent resources (managed/unmanaged) don’t need to waste time being closed until after the end-user disposes the object providing the enum. However, you could suffer a penalty if the end-user needs to repetitively access the same enum when having “cached” data in a collection would increase successive calls, resulting in the lack of a need to build up a collection after the first request. Is the collection being cached? What type of collection is it? A hybrid dictionary seams like it would be optimal in this case since it can handle small and large lists of data differently. Are we working with excessive amounts of data or objects that hold blobs? An enumerator on the fly may be preferable in this case so that performance isn’t hindered by an excessive use of memory.

Two weeks later, on October 15, 2008, at 8:21 AM, one person said that if you had to go to the henhouse, collect all your eggs in your basket while you’re there. If they’re already in the fridge, let it yield them up for your omelet on the fly.

My follow-up question on October 15, 2008, at 1:36 PM was: What do you do if you can’t carry all the eggs back in one trip, or if an egg is bigger than you? You would need to make many small trips while keeping the door open, bring the family to the henhouse for dinner, or have someone help carry the egg back.

Note:

Although the article announcing the winners appears to be published on September 22, 2008, the Internet Archive Way Back Machine is showing that I answered on October 1st, 2008, and then a flurry of people started adding more to the forums on October 15, 2008. From this, I would surmise that the original contest began on October 1, 2008, and the winners were announced on October 15, 2008. The Internet tends to change over time, and after 18 years, the forums are preserved via Internet Archive, and the page announcing the contest appears different.

Discover more from Lewis Moten

Subscribe now to keep reading and get access to the full archive.

Continue reading