Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Does amount of code compiled for a page affect server performace?

Reply
Thread Tools

Does amount of code compiled for a page affect server performace?

 
 
CB
Guest
Posts: n/a
 
      02-23-2004
I have what must be a very common design issue in web programming, probably discussed 2000 times already, but I can never find any mention by searching. In particular

I have a web page with a form, which is posted to the server when the user is finished. The next stop for the user might be a return to a list, or it might be to refresh the form, depending on circumstances. Which of the followng is better programming technique

1) Post the form data to an intermediate script which handles the database update, and then issues a response.redirect to either the list or the original form depending on circumstance

2) Decide on the next stop using javascript on the client side, and post the data directly to that location -- either the script that generates the list, or the script that generates the form. Use an include directive at the top of both scripts to pull in the code that does the database updating (a big subroutine in a separate file). Each script decides whether an update is needed by checking posted data, if any

In the old days, IE used to give an annoying alert with any redirect, killing option (1), but now that seems to have changed. So the main disadvantage of (1) seems to be extra traffic to and from the client and maybe a bit of latency

The main disadvantage to option (2) seems to be that more code needs to be compiled for the list script and the form script, an extra 300 lines, even though an update might be required less than half the time either script runs

As I understand how ASP works, a script and all its include files are compiled the first time the script is hit, and they stay in memory for a while, so they are not recompiled every time. So the cost of extra lines of code would be more to compile the first time, and a bit more memory consumed. But how much? Is the difference trivial, or something to worry about

At one extreme, an ASP-driven website could consist of just one url, one file, which pulls in all the rest of the code with a long set of includes, and decides which code to execute and what to present to the user based on information in the request. At the other extreme, code can be atomized into dozens or hundreds of single-purpose files, and volley the user to the right next page using response.redirect. From a pure server performance standpoint, would either extreme be the best type of application design? Or is the best somewhere in the middle?
 
Reply With Quote
 
 
 
 
Bullschmidt
Guest
Posts: n/a
 
      02-23-2004
<<
...I have a web page with a form, which is posted to the server when the
user is finished. The next stop for the user might be a return to a
list, or it might be to refresh the form, depending on circumstances.
Which of the followng is better programming technique:

1) Post the form data to an intermediate script which handles the
database update, and then issues a response.redirect to either the list
or the original form depending on circumstance.

2) Decide on the next stop using javascript on the client side...
>>


Here's the concept I like to use:

ASP Design Tips - Post Back Page
http://www.bullschmidt.com/devtip-postbackpage.asp

Best regards,
J. Paul Schmidt, Freelance ASP Web Developer
http://www.Bullschmidt.com
ASP Design Tips, ASP Web Database Demo, Free ASP Bar Chart Tool...


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How does code metrics affect your motivation? Academic survey RLC Java 6 03-01-2012 06:41 PM
How does code metrics affect your motivation? Academic survey RLC C++ 11 02-09-2012 09:10 AM
If I create a page, then it's compiled upon first request, where cani find the compiled code?? lander ASP .Net 5 03-05-2008 04:34 PM
Length of Variable Names Affect Compiled Executable? John C Programming 16 09-29-2006 09:41 AM
g++ compiled C++ code called from gcc compiled C code Klaus Schneider C++ 1 12-02-2004 01:44 PM



Advertisments