Some of the performance work that I have been doing recently was complex, and then, some of it isn’t:
And its implementation:
And the optimized version:
And the result?
The really interesting thing is that we have an improvement that is about 3 times more than we would expect. Why is that?
We can see that we eliminated the ResouceName call, and saved all of that cost, but we have much lower cost overall, where did that come from?
This is something that we saw over and over again. The obvious answer is that we now do less allocations, so we have less GC work to do, which is true as far as it goes, but it is also true that when we are even slightly faster, things start to align more closely, and we get a chain reaction (slightly less work means more time process the actual requests, so we can get more done in less).