autoeventwireup performance cost

后端 未结 4 1194
情书的邮戳
情书的邮戳 2021-01-12 10:35

I have been looking at improving my asp.net page performance, is it worth changing autoeventwireup from true to false and adding the event handlers or is the performance pen

4条回答
  •  耶瑟儿~
    2021-01-12 11:02

    The performance is 0, because once wired up (once your application is compiled in memory), it never has to do it again. What I mean by that is, the ASP.NET framework isn't constantly itterating through every method by name to see if it should be wired up.

    But, I strongly suggest you turn it off, because it usually causes issues of double page loads or whatever (if you wire up an event yourself, but due to naming it a certain way, ASP.NET wires it up too).

    That's a feature that I wish was defaulted to off.

提交回复
热议问题