I came across incredibly good behavior with PostSharp. To evaluate the speed, I wrote a small program that will perform one function a certain number of times, and if PostSharp is turned on, it will generate and delete several hundred lines, only in memory (unfixed composition, so they are not automatic, interned). The cycle is executed in non-trivial (several milliseconds) time.
Now I can’t measure the difference over several million circulations, and the crazy launch of ~ 40 billion iterations made a difference of only a few nanoseconds against the non-PostSharp version making the same number of calls. This is impossible for me. There should be something wrong with my test. I had code verified by my colleagues, so I'm sure the code does what I intend.
So, is there something wrong with using string generation (what is the expected use in the intended applications) as a slow simulation for benchmarks?
Alternatively, did someone else perform (or know) PostSharp runtime performance analysis?
Thank.
source
share