Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Snitz Forums 2000 DEV-Group
 DEV Internationalization (v4)
 Performance Tests #2 - Includes & Server.Execute
 Forum Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

Deleted
deleted

4116 Posts

Posted - 18 August 2002 :  14:23:40  Show Profile
I continue to run performance benchmarks on for-us-important topics: This time INCLUDE's and Server.Execute...

Introduction
<ul>
<li>Testbed: P3-733, 512MB Ram, Win 2K Adv Srv SP3, IIS 5, closed many unnecessary services, firewall, virus checking etc, ran it with about 400MB free RAM.</li>
<li>I ran the scripts on the same machine using IE 5.5 SP 2</li>
<li>The timer code of the forum is used to measure the execution time between the start and end of the script, so it will not include any disk I/O</li>
<li>I used the Lang1033's variables (1972 vars), added to them Lang1031 and Lang1055 for multiple INCLUDEs. In this test, all INCLUDE files are UTF-8 encoded and are 205k, 221k and 211k respectively. The variables are not DIM'med (and they are not constants of course).</li>
<li>I ran the tests 10 times and took the average. I each case the variance was negligable.</li>
<li>The data from first run is not taken into account (because IIS 5 precompiles the files in the first run, if necessary), I pressed Ctrl+F5 for the second run.</li>
<li>I took the iteration as 1000 in all tests. All times are in seconds.</li>
<li>I don't include TEST-0 here, which measures the loop execution time, whitout doing anything, as it is negligable (about 0.0005 sec for 1000 iterations).</li>
</ul>

I tried to determine which one is (how much) better:
<ol type="1">
<li>Using the code in the host file as is,</li>
<li>Using INCLUDE directives for single language case</li>
<li>Using Server.Execute command for single/multiple language case</li>
<li>Using INCLUDE directives for multiple language case</li>
</ol id="1">


<b>TEST-1 (no include case)</b>
I cut paste the contents of Lang1033.asp file into the main file, but didn't use UTF-8 encoding during save.

<b>test_include1.asp: 1000*(bare Lang1033.asp)</b>
<pre id="code"><font face="courier" size="2" id="code"><font color="blue">
timer start
for i=1 to 1000
'assign all vars
strLangActive00010 = "All Forums" '"All Forums"
strLangActive00020 = "Active Topics Since " '"Active Topics Since "
...
next
timer stop
</font id="blue"></font id="code"></pre id="code">

<b>test_include2.asp: 1000*(Single INCLUDE case)</b>
<pre id="code"><font face="courier" size="2" id="code"><font color="blue">
strLangAppliedCode = "1033"
timer start
for i=1 to 1000
%>
<!-- #INCLUDE FILE="lang1033.asp"-->
<%
next
timer stop
</font id="blue"></font id="code"></pre id="code">

<b>test_include3.asp: 1000*(Single Server.Execute case)</b>
<pre id="code"><font face="courier" size="2" id="code"><font color="blue">
strLangAppliedCode = "1033"
timer start
for i=1 to 1000
Server.Execute "Lang1033.asp"
next
timer stop
</font id="blue"></font id="code"></pre id="code">

After seeing the results of TEST3 (which was a surprise for me), I run TEST4 to compare it with the multiple simultaneous languages case. I chose 3 language case, as this is the maximum suggested.

<b>test_include4.asp: 1000*(3 INCLUDEs case)</b>
<pre id="code"><font face="courier" size="2" id="code"><font color="blue">
strLangAppliedCode = "1033"
timer start
for i=1 to 1000
%>
<!-- #INCLUDE FILE="lang1031.asp"-->
<!-- #INCLUDE FILE="lang1033.asp"-->
<!-- #INCLUDE FILE="lang1055.asp"-->
<%
next
timer stop
</font id="blue"></font id="code"></pre id="code">

This last case is very similar to what we used in v4b03. Beware, not all language variables are executed here. Although all INCLUDEs are loaded, only the selected language for a particular user gets executed, with the help of the IF-THEN statement in the language files:

<blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote">
strLang_ThisFileLCID = "1033"
if (CStr(strLangAppliedCode) = strLang_ThisFileLCID) then
<hr height="1" noshade id="quote"></blockquote id="quote"></font id="quote">

<hr noshade size="1">

<b>TEST RESULTS</b>

<pre id="code"><font face="courier" size="2" id="code">
<b> TEST-1 TEST-2 TEST-3 TEST-4</b>
<b>AVG</b> 6.66 6.68 21.18 7.03
<b>VAR</b> 0.0010 0.0010 0.0108 0.0010
<b>INDEX</b> 100 100 318 106
</font id="code"></pre id="code">

<b>PRELIMINARY CONCLUSION</b>

Having the language data in an INCLUDE file seems not to effect performance, but this is because it is INCLUDEd once, not thousand times. We need to measure it with the web stress tool, not with this method.

Same happens with 3 INCLUDE case. The difference [7.03-6.68]/2 = 0.175 sec can be interpreted as the overhead of including one additional language file.

On the contrary, server.execute must be evalualed on every iteration, so that the difference [21.18-6.66] / 1000 = 0.05452 sec can be interpreted as execution time required for a single server.execute.

I was thinking to advise server.execute method for better performance for users with IIS5, but I cannot come to a conclusion without the web stress tool.

Another thing is, with IIS5's server.execute, we can use a small install procedure and no further file editing like we do in config.asp in v4b03.x, to make v4 run with multiple simultaneous languages...

Except web tress tool (where I don't have the setup), this also needs to be tested on a NT4 machine. If anybody volunteers to do these tests, I can send the files...

Stop the WAR!
  Previous Topic Topic Next Topic  
 Forum Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.14 seconds. Powered By: Snitz Forums 2000 Version 3.4.07