Perf. of #include vs. Server.Execute

Results 1 to 3 of 3

Thread: Perf. of #include vs. Server.Execute

  1. #1
    MattL Guest

    Default Perf. of #include vs. Server.Execute

    Hi folks,<BR><BR>I was curious as to whether anyone&#039s done any side-by-side performance testing of using the "old" SSI directives vs. Server.Execute.<BR><BR>Specifically, my suspicion is that Server.Execute should cause the server to cache the script bytecode once it&#039s been run (as it would any other ASP page), which means, theoretically, you should realize a net performance increase as compared to simply extending a running script with #include. However, this is entirely my own speculation; does anybody know for certain?<BR><BR>Thanks,<BR>-Matt<BR>

  2. #2
    SPG Guest

    Default Perf. of Apples v. Oranges

    Use whatever works for you. Chances are that if you&#039re using #include properly, Sever.Execute will do nothing for you.<BR><BR>Server.Execute doesn&#039t give or take variables (even global ones) from other scripts. It can pick up on session and application objects -- but only if you&#039re willing to take the overhead to use them (so don&#039t forget that in the performance monitoring).<BR><BR>Server.Execute runs once. The bytecode is not available after that, even if it is cached (hence, any time you need to run a routine, you have to set up an ASP level variable, server.Execute a script and then get the results back from that ASP level variable). Compare this to an #include which will allow you to use a routine -- passing standard local or global (or even ASP-level, if you&#039re using them) -- to get the information you want.<BR><BR>In short, Server.Execute is a hack, not a coding practice; a macro, not an object-oriented block of reusable code. Any performance improvement you realize over the use of a #include directive probably means you weren&#039t using the #include properly.<BR><BR>Hopefully you&#039re a bit more illuminated now.<BR>Grumpy &#039ol SPG

  3. #3
    Join Date
    Dec 1969

    Default RE: Perf. of Apples v. Oranges

    I concur. Server.Execute sucks. Server.Transfer has its uses, but I have yet to find one good use for Server.Execute... #include, baby, it&#039s the way to go! :-)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts