Performance of Object.GetType()

前端 未结 7 1827
花落未央
花落未央 2020-12-05 03:44

We have lots of logging calls in our app. Our logger takes a System.Type parameter so it can show which component created the call. Sometimes, when we can be bothered, we

7条回答
  •  一个人的身影
    2020-12-05 04:19

    using field is the best way and it avoid internal dictionary lock causing by typeof() and GetType() to keep unique reference.

提交回复
热议问题