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

后端 未结 4 1746
花落未央
花落未央 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:51

    SortedSet includes a TargetedPatchingOptOut attribute, did your copied version include that?

    [TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]
    public bool Add(T item)
    {
        return this.AddIfNotPresent(item);
    }
    

提交回复
热议问题