I have been looking at improving my ASP.NET page performance. Is it worth changing autoeventwireup
from true
to false
and adding event handlers, or is the performance penalty very small?
This is an ASP.NET 2.0 project.
When AutoEventWireup is true , ASP.NET does not require that you explicitly bind event handlers to a page event such as Load. When AutoEventWireup is true , handlers are automatically bound to events at run time based on their name and signature.
The AutoEventWireUp property when True, automatically wires up some of these built-in events in the Page life cycle to their handlers. This means that you do not need to explicitly attach these events (using the Handles keyword, for instance, in VB). Examples of these built-in events would be Page_Init and Page_Load .
The ASP.NET page framework supports an automatic way to associate page events and methods. If the AutoEventWireup attribute of the Page directive is set to true, the page framework calls page events automatically, specifically the Page_Init and Page_Load methods.
The wireup isn't done at compile-time. It's done at runtime. As described in this article:
http://odetocode.com/Blogs/scott/archive/2006/02/16/2914.aspx
There IS a performance penalty because of the calls to CreateDelegate which must be made every time a page has been created. The performance hit is probably negligible, but it does exist.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With