Code slower in release mode..?


  • I recently re-wrote a binary file format library, since my old version was so terribly coded. My new library has proven to be twice as fast according to dotTrace and ANTS.

    But it's strange. I'll measure performance with the Stopwatch and its much, much slower than dotTrace and ANTS says it is.

    What's even more strange, is that I realized that the DEBUG build of my testing application (console app that just creates a new file with my library) is FASTER than the release build! 

    Testing with the Stopwatch class, the debug build runs at 00::00::00.042 on average. In the release build, it runs at 00::00::00.083 on average.

    Does anyone know why this might be happening?



    10 พฤษภาคม 2555 22:41