Iv wrote some C# code which seemed to be taking its sweet time, but getting the job done. I then rewrote the code to a slightly faster version, although its not speedy (its a cms admin area function so not critical to the site)
Anyway it got me thinking if there are any tools/techniques out there that allow a/b testing for functions in asp.net/C#
I basically want to provide two functions, and get the execution times etc for each one.
Any one come across any tools for this?
Had a Google and looked on here but couldn’t find anything for benchmarking two functions
I guess I’m looking for jsPerf but in vs2010 and for C#
Any ideas?
You could either use ANTS Profiler http://www.red-gate.com/products/dotnet-development/ants-performance-profiler/ (payable product but they have a Trial version) or some other Profiler product (ANTS, vTune, OptimizeIt, DevPartner, YourKit, dotTrace) on the market.
You may also intstrument the functions by yourself by setting up some unit tests that execute those 2 functions using a manual StopWatch instrumentation to compare execution time (quicker and less expensive). Unit tests would also allow for assuring that you do not have any regressions on performance if you need to change the implementation later. http://msdn.microsoft.com/en-us/library/system.diagnostics.stopwatch.aspx