[thelist] using #include

Madhu Menon webguru at vsnl.net
Wed Jul 17 14:25:01 CDT 2002


At 10:49 PM 7/17/2002, Jeremy Weiss wrote:
>My question is, what kind of impact do includes have on load time.  Do they
>slow page loading any, and if so is it a noticable slowdown?

The negligible performance impact due to includes is far outweighed by
their usefulness. I've used up to 10 includes on pages (on high-traffic web
sites) with nary a difference in the load time. Consider the cost of buying
a bit more of RAM or a slightly faster hard disk versus the cost of doing
search and replace across all the pages.

Besides, if your includes are all ASP, they'll get cached anyway.

Now, to get to your real problem...

>One of my asp pages is timing out everytime someone hits it, so I'm trying
>to break up the processing across a couple of pages.

First things first. Identify the bottleneck.

a) Possibly the database (if you're using one). If so, comment out the part
of your code that accesses the db (read and write both). Insert a temporary
"db updated" dummy response.write statement in its place. Does this make
things any faster? If so, you need to figure out which db call is screwing
you. Is it a resource-intensive "SELECT * FROM ..." query? Is it the tables
you update with new data? Isolate it. Then optimise.

b) If nothing conclusive emerges, try using timer code in your ASP and see
where it's getting stuck. Set an inital time variable and then keep using
DateDiff to calculate increments. After every major chunk of code,
response.write the interval passed (I know you can write the code for this
in a couple of minutes). This will also help identify code bottlenecks.

c) Are you sure your server is configured correctly and can handle the load
of your site? If you have access to the entire server, make sure that the
server timeout value is acceptable and that the CPU/RAM is not the bottleneck.

Trust me, it isn't the includes. Want to be sure? Comment the include calls
out and insert the actual contents of the includes directly into the ASP
script. Does your script still time out? There, you've eliminated includes
as the problem.

Hope that helps.

Regards,

Madhu

<<<   *   >>>
Madhu Menon
User Experience Consultant
e-mail: webguru at vsnl.net




More information about the thelist mailing list