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 Discussions (General)
 performance 3.4.03 add new variable to path_info?
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

bjlt
Senior Member

1144 Posts

Posted - 27 October 2002 :  20:58:18  Show Profile
do a search for Request.ServerVariables("Path_Info") you get 21 results.

As bozden's test shows, request.servervariables is relatively slow, some of them can be replaced by a new variable such as strPathInfo (actually in inc_groupjump_to.asp there is strPathInfo = Request.ServerVariables("Path_Info")

This is esp for the one in config.asp and inc_header.asp as they almost exit in evey page at the same time.

Suggestion:

pop_datepicker.asp

add new variable and replace all three instances of Request.ServerVariables("Path_Info")

config.asp

added dim and replaced

Dim strPathInfo, strCookieURL
strPathInfo = Request.ServerVariables("Path_Info")
strCookieURL = Left(strPathInfo, InstrRev(strPathInfo, "/"))

(also added const to strUniqueID)
Const strUniqueID = "......"

inc_header.asp replaced 7 instances

inc_groupjump_to.asp
removed the line
strPathInfo = Request.ServerVariables("Path_Info")
as we've got the value in config.asp already.



setup.asp unchanged as it's not run often.
admin_mod_dbsetup.asp and admin_mod_dbsetup2.asp, you may replace them as they already got their value in included config.asp, or leave them alone as they are not run often.


Deleted
deleted

4116 Posts

Posted - 27 October 2002 :  21:15:21  Show Profile
Here are how it is done in v4b04:


Dim strScriptName, strTempArr, strScriptFileName, strPathInfo
strScriptName = Request.ServerVariables("script_name")
strTempArr = Split(strScriptName, "/")
strScriptFileName = lcase(strTempArr(Ubound(strTempArr)))
strPathInfo = Request.ServerVariables("Path_Info")

strCookieURL = Left(strPathInfo, InstrRev(strPathInfo, "/"))
strUniqueID = "Snitz00"


All instances of Request.ServerVariables("path_info") and Request.ServerVariables("script_name") related code everywhere is optimized by using these new global variables.

(noted here for compatibility reasons)

Stop the WAR!
Go to Top of Page

bjlt
Senior Member

1144 Posts

Posted - 28 October 2002 :  02:23:20  Show Profile
searched for other servervariables
inc_header.asp
Request.ServerVariables("HTTP_REFERER")
Request.ServerVariables("URL")
are both used twice

register.asp
Request.ServerVariables("REMOTE_ADDR") is used twice

same severvariables are requested more than once also in post.asp and post_info.asp but they are in different cases there, so no need to change.

will you add dim and const for these?
Dim strCookieURL
Const strUniqueID

btw, bozden, can I have what you have done on lcid? happy snitzing
Go to Top of Page

Deleted
deleted

4116 Posts

Posted - 28 October 2002 :  08:25:16  Show Profile
I don't plan to add more at this stage, but the use of variables for some cookie calls can be worth to examine. It is not so much error prone on the other hand.

quote:

btw, bozden, can I have what you have done on lcid?


If you mean the code that maps the browser language codes to a locale, that code is integrated in v4b04 code and uses some global stuff which will be not easy to explain. Please wait a bit more .


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