June 2004 - Posts

.NET Framework 2.0 Performance

I must say that I am impressed with the performance of .NET Framework 2.0.  I wrote a Media Library that if given a folder will iterate through all the directories and add all the files to a DataSet with various tables.  I have a table called “Audio” for all audio files (i.e. MP3, OGG, etc) and a table called Video for the various video files.  On the audio side I read in the MP3 tags, all version from 1.0 to 2.4.

First, the way I wrote my algorithm is obviously good, since compared to other popular media players out there, it is very fast.  Reading 1100 MP3's off a network drive and reading all the ID3 tag info was the test I was shooting for...  I tested Winamp, Windows Media Player 9.0, and others.

Windows Media Player 9.0 took 2 minutes.  Winamp tool about 1 minute and 45 seconds.  My media library did it in 38 seconds.

I used C# with a combination of FileStream and MemoryStream.  I also used a DataSet for storing with a combination of Generic Lists of type string.  To compare, this took anywhere from 50 seconds up to a minute with .NET Framework 1.1.  One major place that helped was the performance increase of the System.Xml namespace.  MS did some great work tuning it this time around.

I am sure most of you using have seen other areas where performance has increased and those of you who have not, I am sure you will be pleased when you port your code over.

Posted by bstahlhood | 2 comment(s)
Filed under: ,
More Posts