[thelist] using includes and performance issues

Ken Schaefer ken at adOpenStatic.com
Fri Feb 14 00:51:01 CST 2003


A couple of things come to mind:

a) Yes there is a performance penalty in using include files. However you
won't actually notice this unless you include a large amount of code.
Include a few thousand lines of code, and then hit the page for the first
time. You'll see that it'll take 5-6 seconds (at least) before the page it
returned to you. This is when the ASP engine is "psuedo-compiling" the page
(assuming you are caching ISAPI applications).

b) Inline includes look clunky (especially when interspersed with ASP code).
A better way to do this would be to write a routine (eg a function in
VB-esque talk) that returns the necessary HTML. That way you include the
code to write the HTML only once, but can call it many times through-out the
page. Include this function at the top of your page (with all your other
includes - makes your code look a lot nicer as well).

Cheers
Ken

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: "Tom Dell'Aringa" <pixelmech at yahoo.com>
Subject: [thelist] using includes and performance issues


: Question:
:
: I'm working with a client who is putting a bunch of things in include
: files (now is ASP, will end up in JSP). This is a heavy table driven
: site, and most of the includes are tops and bottoms of different
: styles of tables, a top one would look like this:
:
: <table width="95%" cellpadding="3" cellspacing="1" border="0"
: align="center" class="PanelBorder">
: <tr class="GroupHeader">
: <td class="GroupHeader" valign="top">
:
: and it would have the corresponding bottom one, so for that one table
: you would have two includes like this:
:
: <!--#include file="../global/includes/top.asp"-->
: interior table
: <!--#include file="../global/includes/bottom.asp"-->
:
: I might have 2-3 tables on a page, plus some other elements (for/next
: arrows, stuff like that) that are also includes.
:
: I'd say the average page has 10 includes. Some have less, some more
: detailed pages have more.
:
: Does this affect performance issues? If so how? I understand their
: desire to keep a design standard and using includes is one way, and
: the pages are all slightly different.




More information about the thelist mailing list