Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Sql Version - MapPath not needed
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Sql Version - MapPath not needed

 Post Reply Post Reply
Author
kmacy View Drop Down
Groupie
Groupie
Avatar

Joined: 15 March 2002
Location: United States
Status: Offline
Points: 73
Post Options Post Options   Thanks (0) Thanks(0)   Quote kmacy Quote  Post ReplyReply Direct Link To This Post Topic: Sql Version - MapPath not needed
    Posted: 18 November 2003 at 12:48pm

I was looking through the code and noticed if you are running the Sql Server version there are a couple of lines in the code that you can comment out (or wrap in an if then statement checking for Sql version).

I wouldn't even bring it up but the server.mappath is an expensive method because it has to read the file system each time it is called. 

So, unless Borg says different, I'm going to comment out the following 2 lines in the common.asp file. (Only for SQL SERVER version!)

1) strDbPathAndName = Server.MapPath("admin/database/wwForum.mdb") 'This is the path of the database from this files location on the server

2)strCon = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & strDbPathAndName 'This one is for Access 2000/2002 .

Borg,
Actually, you might just want to move:
'Set the diffrent variables for diffrent database types
If strDatabaseType = "SQLServer" Then %>

up a few lines to right under :
Set adoCon = Server.CreateObject("ADODB.Connection")

and then add a "Not" since you are already testing for SqlServer anyway.



Edited by kmacy
Ken Macy
Back to Top
kmacy View Drop Down
Groupie
Groupie
Avatar

Joined: 15 March 2002
Location: United States
Status: Offline
Points: 73
Post Options Post Options   Thanks (0) Thanks(0)   Quote kmacy Quote  Post ReplyReply Direct Link To This Post Posted: 18 November 2003 at 1:15pm

Just for grins, I re-ran the base test of AspForum7.6 3 more times and came out to: (if you don't know what I am talking about read my earlier post)

64 requests per seconds (exact same as before)

Then I commented out the server.mappath call mentioned above and reran the test 3 times and got this:

68 requests per second.

May not seem like a lot but that simple little change is a 6% increase. Not bad for just making a simple little change.

 

Ken Macy
Back to Top
WebWiz-Bruce View Drop Down
Admin Group
Admin Group
Avatar
Web Wiz Developer

Joined: 03 September 2001
Location: Bournemouth
Status: Offline
Points: 9844
Post Options Post Options   Thanks (0) Thanks(0)   Quote WebWiz-Bruce Quote  Post ReplyReply Direct Link To This Post Posted: 19 November 2003 at 2:51am
Thanks I'll look into it.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.