Warm-up when calling methods in C#

前端 未结 4 721
情歌与酒
情歌与酒 2020-11-30 11:44

I just came across this post that talks about time measuring. I remember (I hope I\'m not misremembering) it\'s an unfair competition, if this method is never called before.

4条回答
  •  清歌不尽
    2020-11-30 12:12

    If by "warm up" you refer to JIT'ing then yes - if a method is never called it won't have been compiled yet, so the very first time you run it it might be slower. Also refer to Does the .NET CLR JIT compile every method, every time?

提交回复
热议问题