Sunday, August 1, 2010

Improved startup time - up to 80% faster

Hi,

A day late I have finished doing some benchmarking on the startup time of Yama. I have moved a lot of code into threads that run in the background. This makes the main window appear more quickly and gives you the impression of a snappier application.

The test was fairly simple. I have two computers:

System 1
CPU: Core 2 Duo @ 2.66 Ghz
RAM: 4 Gb DDR3
OS: Windows 7 64-bit
Tracks: 6 851

System 2
CPU: Core Duo @ 1.86 Ghz
RAM: 2 Gb DDR2
OS: Windows 7 32-bit
Tracks: 24

I ran Yama five times before the optimizations and five times after. Each run I recorded the time it took from the first line of code in the startup procedure to the last line..

Worth noting here is that System 1 has several thousand tracks, while System 2 has just 24. This made Yama slow since it had to read all those tracks from the settings file on the harddrive each time it started. It still has to do that but now this code has been moved out into a thread that runs in the background. In fact, all code that interacts with the harddrive during startup has been moved into background threads. The startup time after the optimizations is now spent on one thing: Initialize the GUI. The GUI is initialized by Windows so I can't do much about that part. But at least now you won't suffer any performance hits during startup if you have a large number of tracks or playlists.

So, on to the actual numbers. The decrease in startup time on System 1 is 80%, going from 2.40 seconds to 0.47 seconds. System 2 saw a smaller dip of 64% going from 1.89 seconds to 0.69 seconds.

It is my intention to make Yama feel very lightweight and fast. Hopefully this will do exactly that.