Tested with netcore1.1/2.0/2.1(2.1.300-preview2-008347)/net471 x64, seems not happened with x86build.
Test Code
https://github.com/yyjdelete/JIT_Test
I'm not sure if it's an issue since I'm not familiar with JIT, but has some questions.
- Why all
ThrowWithCall(Error.ThrowExpection(string.format(...));) has rep stos but not for ThrowDirect(throw Error.CreateExpection(string.format(...));), the latter one is about 50% faster with all cases in the test code.
- Why when call directly into
CheckIndex0ThrowWithCall, the Branch Prediction didn't work well by move throw to the end but it's well for all others(RunThrowWithCall, which is just a call to CheckIndex0ThrowWithCall);
- What's the different between
CheckIndexThrowDirect and CheckIndexThrowDirect2, why jmp Test in the first case and call Test for the second.
category:cq
theme:inlining
skill-level:expert
cost:small
Tested with netcore1.1/2.0/2.1(2.1.300-preview2-008347)/net471 x64, seems not happened with x86build.
Test Code
https://github.com/yyjdelete/JIT_Test
I'm not sure if it's an issue since I'm not familiar with JIT, but has some questions.
ThrowWithCall(Error.ThrowExpection(string.format(...));) hasrep stosbut not forThrowDirect(throw Error.CreateExpection(string.format(...));), the latter one is about 50% faster with all cases in the test code.CheckIndex0ThrowWithCall, the Branch Prediction didn't work well by move throw to the end but it's well for all others(RunThrowWithCall, which is just a call toCheckIndex0ThrowWithCall);CheckIndexThrowDirectandCheckIndexThrowDirect2, why jmpTestin the first case and callTestfor the second.category:cq
theme:inlining
skill-level:expert
cost:small