User Profiles: Fixing Differences in Performance - نوشته شده در (4861 Views)
Average Member
SiSL
مطلب: 671
671
What may cause this?
Here some results,

As admin, my profile page (when looking at others profiles pop_profile.asp) is created like 0.8 seconds, as user 32.85 seconds... But there should not be that much difference between admin & user, right? I mean where I can try to find solution in codes?
What may cause this?
Mods I have installed:
- Anti-spam mod (cant recall exact name)
- Avatar mod
- Poll mod
- Active Users

NOTE: I have tried it several times and got it tried to some of my users.
TXT Version of POP_PROFILE.ASP
TXT Version of INC_PROFILE.ASP
Moved and renamed by ruirib<
 پیش‌فرض مرتب‌سازی برای تاریخ DESC به معنی جدیدترین است  
 تعداد در صفحه 
نوشته شده در
Snitz Forums Admin
ruirib
مطلب: 26364
26364
Very weird. That's not a common issue at all. Maybe post a link to a text version of your pop_profile.asp and inc_profile.asp files. <
نوشته شده در
Dev. Team Member & Support Moderator
OneWayMule
مطلب: 4969
4969
You might want to try to disable the Recent Topics feature (Admin Options -> Member Details Configuration) and see if it makes any difference.<
نوشته شده در
Average Member
SiSL
مطلب: 671
671
ruirib: Added txt versions of files into first posts.
OneWayMule: I will try and let you know the results.<
نوشته شده در
Average Member
SiSL
مطلب: 671
671
Recent topics made the difference, but what causing difference in recent topics between admin & users I wonder :(<
نوشته شده در
Support Moderator
Podge
مطلب: 3776
3776
This won't help you but it happened here at Snitz once - http://forum.snitz.com/forum/topic.asp?ARCHIVE=true&TOPIC_ID=57286&whichpage=1

No cause found. It was fixed by moving to a new server.<
نوشته شده در
Average Member
SiSL
مطلب: 671
671
It is almost very same problem. HuWR was getting fast results as admin, but users dont, hence I dont have chance to change my host since it is co-location computer. Just wondering if it is from MSSQL settings should be different or what.


<
نوشته شده در
Snitz Forums Admin
ruirib
مطلب: 26364
26364
SiSL,

In your pop_profile.asp, around line# 399, here now you have,
Code:

                                        strsql = "SELECT F.FORUM_ID"
strSql = strSql & ", T.TOPIC_ID"
strSql = strSql & ", T.T_SUBJECT"
strSql = strSql & ", T.T_STATUS"
strSql = strSql & ", T.T_LAST_POST"
strSql = strSql & ", T.T_REPLIES "
strSql = strSql & " FROM ((" & strTablePrefix & "FORUM F LEFT JOIN " & strTablePrefix & "TOPICS T"
strSql = strSql & " ON F.FORUM_ID = T.FORUM_ID) LEFT JOIN " & strTablePrefix & "REPLY R"
strSql = strSql & " ON T.TOPIC_ID = R.TOPIC_ID) "
strSql = strSql & " WHERE (T_DATE > '" & strStartDate & "') "
strSql = strSql & " AND (T.T_AUTHOR = " & ppMember_ID
strSql = strSql & " OR R.R_AUTHOR = " & ppMember_ID & ")"
strSql = strSql & " AND (T_STATUS < 2 OR R_STATUS < 2)"
strSql = strSql & " AND F.F_TYPE = 0"
strSql = strSql & " ORDER BY T.T_LAST_POST DESC, T.TOPIC_ID DESC"

replace it by
Code:

	                                strsql = "SELECT F.FORUM_ID"
strSql = strSql & ", T.TOPIC_ID"
strSql = strSql & ", T.T_SUBJECT"
strSql = strSql & ", T.T_STATUS"
strSql = strSql & ", T.T_LAST_POST"
strSql = strSql & ", T.T_REPLIES "
strSql = strSql & " FROM (" & strTablePrefix & "FORUM F INNER JOIN " & strTablePrefix & "TOPICS T"
strSql = strSql & " ON F.FORUM_ID = T.FORUM_ID)"
strSql = strSql & " WHERE (T_DATE > '" & strStartDate & "') "
strSql = strSql & " AND (T.T_AUTHOR = " & ppMember_ID & ")"
strSql = strSql & " AND (T_STATUS < 2)"
strSql = strSql & " AND (T_REPLIES < 1) AND F.F_TYPE = 0"
strSql = strSql & " UNION"
strsql = strsql & " SELECT F.FORUM_ID"
strSql = strSql & ", T.TOPIC_ID"
strSql = strSql & ", T.T_SUBJECT"
strSql = strSql & ", T.T_STATUS"
strSql = strSql & ", T.T_LAST_POST"
strSql = strSql & ", T.T_REPLIES "
strSql = strSql & " FROM ((" & strTablePrefix & "FORUM F INNER JOIN " & strTablePrefix & "TOPICS T"
strSql = strSql & " ON F.FORUM_ID = T.FORUM_ID) INNER JOIN " & strTablePrefix & "REPLY R"
strSql = strSql & " ON T.TOPIC_ID = R.TOPIC_ID) "
strSql = strSql & " WHERE (T_DATE > '" & strStartDate & "') "
strSql = strSql & " AND (R.R_AUTHOR = " & ppMember_ID & ")"
strSql = strSql & " AND (T_STATUS < 2 OR R_STATUS < 2)"
strSql = strSql & " AND F.F_TYPE = 0"
strSql = strSql & " ORDER BY T.T_LAST_POST DESC, T.TOPIC_ID DESC"

Let me know if it improves on your problem.
P.S.:This code is good only for Access or SQL Server. MySQL versions that support UNIONS (4.0+) should also be ok, BUT NO TESTING WAS DONE.<
نوشته شده در
Average Member
SiSL
مطلب: 671
671
It is now much faster for 'admin' but still having (will keep code)

This page was generated in 0.41 seconds. = admin
This page was generated in 23.06 seconds. = user

You can see at http://www.amedia.org/forum/

user: demo
pass: test<
نوشته شده در
Snitz Forums Admin
ruirib
مطلب: 26364
26364
Can you compare both versions of the file (with and without the change) regarding the recent posts that appear for each user? I think they should be, but want to be sure...<
نوشته شده در
Snitz Forums Admin
ruirib
مطلب: 26364
26364
The difference in performance quite surely results from the fact that each topic must be evaluated against users permissions, to ensure that the user viewing the profile has access to the topics.
Using getrows instead of the navigating the recordset could also help improving the performance.<
شما باید یک متن وارد کنید