What is the reason behind this huge Performance difference in .Net 4

后端 未结 4 1745
花落未央
花落未央 2021-01-31 05:40

I was just doing some research on RedBlack Tree. I knew that SortedSet class in .Net 4.0 uses RedBlack tree. So I took that part out as is using Reflector and created a RedBlack

4条回答
  •  悲哀的现实
    2021-01-31 05:54

    If the difference wasn't that big I would suggest that the cause is that the .NET assemblies are NGen-ed and so they are already translated to native code. In the case of your class the time to compile the IL code into native code is amortized over the time of your test. How does increasing the number of loop iterations affect the times?

提交回复
热议问题