Re: Brain-scratcher: New example of the delay
- Posted by CladStone Jun 15, 2009
- 966 views
I am not so sure about this. The slightly different IL in a bound executable may easily account for this.
What's an IL? I don't understand why the code binds differently.
But yes, after a few more tests, I'm willing to concede that this IS a processor caching issue, and that the state is not captured in the bound .exe file. (I found one more like 150 that ran fast, and then I got my 150 to run fast.)
My big question now is about how to avoid the issue. If you'll notice from my original example, there were 2 allocations. The full code was not intended to modify the machine code routine at all. Must I pad any memory block I use for machine code routines with a certain amount of unused memory? If so, do I pad on both ends, or just after? And by how much do I need to pad to make sure I don't run into the issue?