1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Explain 'Compiled code' as it relates to the web please???

Discussion in 'C#' started by nubsii, Apr 2, 2008.

  1. #1
    Hello Everyone,

    I'm struggling with some of the general concepts concerning asp.net especially whenever I try figure out what asp.net is doing or assess performance.

    In a standard HTTP request of an HTML document, the server awaits a request and then sends a message of its own and perhaps the HTML document which can be rendered by the browser. Whats the equivalent process with a *.ASPX?

    Does the Asp.NET app generate HTML per ASPX/ASPC instructions and send it to the user agent? Is it slow? Fast? (relative to loading static html content) Will it do this every time, or just the first time? Does an ASPX file with no dynamic code get treated just like an HTML file? How does using the 'visited composites rendering technique' compare to other ways a page can be shown, and whats the performance cost?

    I've read about all these things but I only have an academic understanding of whats going on. If you can explain or answer any of my bajillion questions and speak in terms of whats going on with ASP.NET compared to what would happen without ASP.NET - then I would love to read your post!
    SEMrush
    Thanks for reading,
    Nubsii
     
    nubsii, Apr 2, 2008 IP
    SEMrush
  2. AstarothSolutions

    AstarothSolutions Peon

    Messages:
    2,681
    Likes Received:
    77
    Best Answers:
    0
    Trophy Points:
    0
    #2
    There are plenty of diagrams showing the different levels of the .Net engine which a request has to go through.

    Naturally as there is more processing done by the server it will be slower than sending a static HTML file, how much slower will depend on the amount of work the server is required to do and the efficiency of the code. If a .aspx file had no dynamic code then it would be slower but the difference would be so minimal it is hardly worth noting but you must also remember that there can be elements in the global.asax file that is called on each request and/ or HTTPHandlers which will all add load to the server.

    The key difference with .Net to classic ASP/ PHP etc is the fact that the code can be precompiled... with classic ASP the server has to load up the file (and any includes) and read through line by line looking for any script to execute which is written in vbscript (most the time) and a fairly high level language (read more processing work). With .Net the code can be precompiled so that the programming is in a single DLL that can be held in memory and is in a mid level lanuage so also quicker to execute.

    If your .Net code isnt precompiled then it will compile on application start but the generated code is only held in memory so once the application stops (shared webhosts kill applications fairly quickly after inactivity to release memory) the code is lost. This does mean the initial request that starts the app is generally fairly slow when the code isnt precompiled.
     
    AstarothSolutions, Apr 3, 2008 IP