ASP.NET is Compiled, Not
Interpreted
One of the major reasons for performance
degradation in ASP scripts was due to the fact that the scripts were written in
either JScript or VBScript, both of which are interpreted scripting languages.
Similarly to a web browser application, a scripting host on the server machine
must interpret these scripts. This design characteristic of ASP poses numerous
issues for web application developers.
q
Frequent file-access issues pertaining
to Windows account impersonation problems
q
Slower application execution as a
result of interpretation
q
Limited language availability
q
Scripting host versioning problems
The very first
time an ASP.NET (ASPX files) page or web service (ASMX files, usually) is
requested by a remote client, the code used to write that file is compiled down
to Microsoft Intermediate Language (MSIL)
code. This first step is the fundamental reason for .NET's language
interdependence: the Common Language Runtime reads MSIL code and then compiles it into machine
code just before execution. This concept, known as "just-in-time" (or
JIT) compiling, enables the application's components – in this case, ASP.NET
pages – to be compiled when and only when
they are needed by the application.
However, an ASPX file need not be compiled
every time it is requested. Once the page has been compiled into machine code
and loaded into the .NET runtime's Global Assembly Cache (GAC) as a result of its very first execution,
it will remain ready for use by any other managed application. Only when the
code you write changes (or you restart your web server or your machine) does
the ASPX page compile again. For this reason, you will most likely note a
slower response time the first time an ASPX page is requested than in
subsequent requests.
With the advent of compiled pages, chances
are that you will see a dramatic increase in performance in your web
applications. As a test, try reworking a simple ASP application using ASP.NET,
and then benchmark your applications against one another. The results might
surprise you!
Buy Fast Track ASP.NET here
© Copyright 2002 Wrox Press
These chapter is written by Brady Gaster, Marco Bellinaso & Kevin Hoffman
and taken from "Fast Track ASP.NET" published by Wrox Press Limited in June 2002; ISBN 1861007191; copyright © Wrox Press Limited 2002; all rights reserved.
No part of these chapters may be reproduced, stored in a retrieval system or transmitted in any form or by any means -- electronic, electrostatic, mechanical, photocopying, recording or otherwise -- without the prior written permission of the publisher, except in the case of brief quotations embodied in critical articles or reviews.
|
|