View Single Post
  #215  
Old 09-15-2006, 08:19 AM
buro9 buro9 is offline
 
Join Date: Feb 2002
Location: London, UK
Posts: 585
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

When I've done the DOM JavaScript stuff I'll post it here. It may be a few weeks though, I'm still running the old javascript on my site, the new stuff I haven't had tested in many browsers (just Firefox on Ubuntu), so I've yet to even get it past IE on Windows And I'm going to be distracted and slow working for a fortnight as my girl is coming to stay for a couple of weeks... this takes a lower priority

As for the basics to make things better now:
In vaispy.php:
REPLACE:
Code:
$daysprune = 1;
WITH:
Code:
$daysprune = 0.04;
That will take one days worth of queries down to 1 hour worth of queries (57.1 minutes to be precise). So even fewer rows in the thread table locked.

In va_spy.js:
REPLACE:
Code:
var xmldelay = 7000;
WITH:
Code:
var xmldelay = 20 * 1000;
AND

REPLACE THE TWO INSTANCES OF:
Code:
setTimeout("getXML()", 5000);
WITH:
Code:
setTimeout("getXML()", xmldelay);
That changes the time between polling for updates from 7 seconds to 20. I prefer doing the math like that as it makes it obvious it's 20 x 1000 milliseconds = 20 seconds.

Changing that you will have taken each users average 10 queries per minute down to 3 queries per minute. Change it to 30 seconds and they'll be down to 2 queries per minute. Any time span higher than this will reduce the beauty and usability of the spy page too much for my liking. But quiet forums could easily get it to 1 minute per poll.

I also don't like * queries in SQL, so I changed in vaispy.php:
Code:
    $getthreads = $db->query_read("
        SELECT thread.*, post.pagetext AS preview, post.userid AS lastpuserid
        FROM ".TABLE_PREFIX."thread AS thread
        LEFT JOIN ".TABLE_PREFIX."deletionlog AS deletionlog ON(thread.threadid = deletionlog.primaryid AND type = 'thread')
        LEFT JOIN ".TABLE_PREFIX."post AS post ON(post.postid = thread.lastpostid)
        WHERE open <> 10 AND thread.lastpostid > $lastpostid
        AND forumid NOT IN (0$blockforums)
        AND thread.visible = '1'
		AND post.visible = 1
        AND deletionlog.primaryid IS NULL
        $datecut
        ORDER BY lastpost DESC LIMIT 10");
TO:
Code:
    $getthreads = $db->query_read("
      SELECT thread.forumid,
             thread.firstpostid,
             thread.lastpost,
             thread.lastposter,
             thread.lastpostid,
             thread.replycount,
             thread.threadid,
             thread.title,
             thread.views,
             post.pagetext AS preview,
             post.userid AS lastpuserid
        FROM " . TABLE_PREFIX . "thread AS thread
             LEFT JOIN " . TABLE_PREFIX . "deletionlog AS deletionlog ON (thread.threadid = deletionlog.primaryid AND type = 'thread')
             LEFT JOIN " . TABLE_PREFIX . "post AS post ON (post.postid = thread.lastpostid)
       WHERE open <> 10
         $datecut
         AND forumid NOT IN (0$blockforums)
         AND thread.visible = '1'
         AND thread.lastpostid > $lastpostid
         AND post.visible = 1
         AND deletionlog.primaryid IS NULL
       ORDER BY thread.lastpost DESC LIMIT 10
    ");
The difference on that is neglible on performance, but I prefer to know what my queries return.
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02082 seconds
  • Memory Usage 1,786KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (8)bbcode_code
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • showpost_complete