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 MOD-Group
 MOD Add-On Forum (W/O Code)
 Optimizing Snitz - default.asp
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

Aaron S.
Average Member

USA
985 Posts

Posted - 17 May 2002 :  18:50:56  Show Profile  Visit Aaron S.'s Homepage
I finally got around to make some changes to default.asp on my Snitz forum.

Here is what I did:

- combined the category and forum SQL queries
- converted to getrows() for this new query only

As you can see, I only changed the main query... I did not get into all the extra calls being made to inc_functions that are made for one reason or another (so hopefully there are more gains to be made).

Some info on my forum --> I have over 50 categories and over 450 forums. I have a MOD that allows a user to choose which categories they want to view (this query is also part of the new larger Db call).

I use an OLEDB connection to a SQL Server Db.

The test I ran was logged in as admin and not logged in with 3 Categories visible.


VISITOR

OLD DEFAULT.ASP

3.5 - 5.5 seconds

NEW DEFAULT.ASP

1.0 - 2.5 seconds


ADMIN

OLD DEFAULT.ASP

3.5 - 8.0 seconds

NEW DEFAULT.ASP

1.2 - 3.0 seconds


I am not sure why the range varies so much... but it is a pretty nice performance gain.

I need to re-read some of the previous topics on default.asp to see what other places I can change to get the most bang.

Then its on to active.asp, forum.asp and topics.asp.

--Aaron



DOWNLOAD GREAT NEW MODS HERE

blackinwhite
Average Member

Turkey
657 Posts

Posted - 17 May 2002 :  19:06:50  Show Profile
I actually like to learn what changes you made exactly.

the results seem very useful.

Go to Top of Page

dreamr_3
Starting Member

7 Posts

Posted - 17 May 2002 :  19:16:22  Show Profile
try modifying chkUser() in inc_functions.asp

It retrieves the access level of the user, but my tests show it being called 3 times for default.asp...

after the first time you could save the result in a variable and then when the function is called check the variable first... if it's empty then query the database, otherwise use the variable... this would kill 2 queries... I can provide code if this isn't enough to go on...

Go to Top of Page

dreamr_3
Starting Member

7 Posts

Posted - 17 May 2002 :  19:17:49  Show Profile
OH, and if username and password are EMPTY, don't even run the query... Snitz does this even when noone is logged in... obviously the access level should be 0 for non-users... no query needed...

Go to Top of Page

dreamr_3
Starting Member

7 Posts

Posted - 17 May 2002 :  19:31:49  Show Profile
If you have moderation turned on at all (I don't think it runs the queries if it's DISABLED) try adding this code to the TOP of CheckForUnmoderatedPosts... oh course test all my examples before putting them in production... :-)

'don't need to know this unless I'm a moderator
if (chkUser(strDBNTUserName,Request.Cookies(strUniqueID & "User")("Pword"))<3) then
CheckForUnmoderatedPosts=0
exit function
end if


Another speed up for users not logged in... no need to check for unmoderated posts... I'm sort of going about updates a little backwards... default.asp should probably be rewritten to eliminate all these calls (and sounds like it is in 3.4) but I find it easier to eliminate them inside the functions, not to mention this provides speed ups for ALL pages that use the functions at once...

Go to Top of Page

blackinwhite
Average Member

Turkey
657 Posts

Posted - 18 May 2002 :  07:47:43  Show Profile
quote:

If you have moderation turned on at all (I don't think it runs the queries if it's DISABLED) try adding this code to the TOP of CheckForUnmoderatedPosts... oh course test all my examples before putting them in production... :-)

'don't need to know this unless I'm a moderator
if (chkUser(strDBNTUserName,Request.Cookies(strUniqueID & "User")("Pword"))<3) then
CheckForUnmoderatedPosts=0
exit function
end if


Another speed up for users not logged in... no need to check for unmoderated posts... I'm sort of going about updates a little backwards... default.asp should probably be rewritten to eliminate all these calls (and sounds like it is in 3.4) but I find it easier to eliminate them inside the functions, not to mention this provides speed ups for ALL pages that use the functions at once...





thanks for the tip, dreamr_3

done it and worked.

any other tips?

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.32 seconds. Powered By: Snitz Forums 2000 Version 3.4.07