I am working on an asp.net web site that is based upon a single gateway page that typically handles all requests and responses. There are a number of classes that get called by the gateway page depending on what’s going on, but there is a lot of code within the main gateway page, split into lots of methods. I understand that the JIT compiler will only load and JIT methods as they become required, and therefore the smaller my methods the better. However, my question is this: does it matter if I have thousands of lines and hundreds of methods within the same aspx.cs file? Should I try to break down the functionality into smaller source files, classes and namespaces? Or in reality will this not make much difference because the .net runtime will only jit and load each method as it becomes necessary? I appreciate people may have coding style contributions here, but I’m realy interested to know exactly what .NET is doing technically so I can make my decision based upon pure performance criteria. Thanks very much. If I do ‘refactor’, what sort of performance difference might I expect to see?
Share
There is no performance issue just because it is in a single file. The issue you have is primarily around maintenance, lack of focus on coding best practices and testability.