What happens the second time an event arrives? It is faster or just as slow. If it is still slow, then JIT is not a problem, because the code receives "JIT" only once, the first time it is run.
NGEN will give you the answer. My suggestion is to take the minimum required code, the critical path, if you like, and put it in the dummy / sandbox project. Start profiling / ngenning this code and see the performance.
If this minimal code, even after NGEN'ed works poorly on multiple calls, then pre-compilation will not help you. Its something else in the code causing the neck of the bottle of performance.
Chaitanya
source share