Take the 2-minute tour ×

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 penalty very small?

This is an asp.net 2.0 project.

share|improve this question
add comment

4 Answers

up vote 9 down vote accepted

The wireup isn't done at compile-time. It's done at runtime. As described in this article:


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.

share|improve this answer
add comment

From MSDN article.

Performance Tips and Tricks in .NET Applications

Avoid the Autoeventwireup Feature

Instead of relying on autoeventwireup, override the events from Page. For example, instead of writing a Page_Load() method, try overloading the public void OnLoad() method. This allows the run time from having to do a CreateDelegate() for every page.

Knowledge Base article:


When to avoid setting the value of the AutoEventWireup attribute to true

If performance is a key consideration, do not set the value of the AutoEventWireup attribute to true. The AutoEventWireup attribute requires the ASP.NET page framework to make a call to the CreateDelegate function for every ASP.NET Web Form page. Instead of using automatic hookup, you must manually override the events from the page.

share|improve this answer
add comment

The performance difference is negligible.

share|improve this answer
what evidence do you have for this claim? –  Jon Nov 5 '08 at 20:05
burden of proof is on the optimizor –  Dustin Getz Aug 21 '09 at 13:28
add comment

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.

share|improve this answer
add comment

Your Answer


