The Is, As and the Is-As - WinDBG
05/11/2018
In the previous post, I have investigated the performance implications of using the is and as keywords, including the new pattern matching syntax for the is
keyword. Let me reference a previous work in this topic from Sasha Goldshtein, which motivated to do the investigation on the new pattern matching syntax of the is keyword: Micro-Benchmarking Done Wrong, And For The Wrong Reasons
In the previous post, I have measured performance with micro-benchmarking and took a look at the code, through ILSpy.
In this post I will take a look at the same code (invoking a non-inlined Work() method) but this time, I will use WinDBG and compare the native code generated by the JIT compiler.
JIT compiler's output may change with version updates of the framework, as this is an implementation detail to the CLR. The generated code also depends on the architecture of the system where we run our code. My test machine is x64 and uses RyuJIT compiler.