Search Results for 'test'
-
AuthorSearch Results
-
January 2, 2009 at 9:34 pm #70731
In reply to: bbpress vs phpbb
chrishajer
ParticipantJanuary 2, 2009 at 7:22 pm #70268In reply to: Separating the first post of each topic
Ben L.
MemberUntested code below:
<?php $bb_post = $posts[0]; unset($posts[0]); $del_class = post_del_class();?>
<div id="post-<?php post_id(); ?>"<?php alt_class('post', $del_class); ?>>
<?php bb_post_template(); ?>
</div>
<h6>Responses</h6>
<ol id="thread" start="<?php echo $list_start; ?>">
<?php foreach ($posts as $bb_post) : $del_class = post_del_class(); ?>
<li id="post-<?php post_id(); ?>"<?php alt_class('post', $del_class); ?>>
<?php bb_post_template(); ?>
</li>
<?php endforeach; ?>
</ol>January 2, 2009 at 6:13 pm #4437Topic: Marinero de agua dulce Forums
in forum Showcase-skipper-
MemberBased on Scoun theme from Mike Lothar.
Plugins used:
– Akismet
– Human Test for bbPress
– bbpress SEO tools
– Allow Images
January 2, 2009 at 9:59 am #70723Sam Bauers
ParticipantSame implementation now in 0.9 branch, if someone could confirm 0.9 that would be great.
January 2, 2009 at 9:40 am #70722Sam Bauers
ParticipantChanges are now in trunk, please test.
0.9 may be a little more hackish to implement.
January 2, 2009 at 9:28 am #70721anotherdan
MemberChris, My page went from loading in 2-8 seconds to 0.200 – 0.300 per request… So yes it was severe – as I said i use this function more than once in the theme…
Ahh there of course is the join filter… Thanks CK I will move this out, so I am able to update the core without a problem… I have another “extremely slow” issue, but I will get back to that later because that’s in the bb-admin part so only few people see that…
January 2, 2009 at 5:46 am #70720Sam Bauers
ParticipantI’ll adjust core in trunk and 0.9 branch to implement this somehow.
January 2, 2009 at 5:44 am #70719_ck_
Participant>> The same performance gain is achieved using the existing forum_time index.
Ah so in that case, no ALTER required and there is zero extra storage required and the plugin can be used like this:
<?php
/*
Plugin Name: Topic Time Index
*/
add_filter('get_latest_topics_join','topic_time_index',99999);
function topic_time_index($join) {return " $join USE INDEX(forum_time) ";}
?>January 2, 2009 at 5:42 am #70718_ck_
ParticipantChris, you are missing the concept that if there are 100 people hitting the mysql server with the same or different queries and they can’t be cached, the load goes up exponentially.
Sam’s benchmark is on a high performance, dedicated mysql server.
Imagine someone with 40,000 records, non-indexed, on a shared server.
January 2, 2009 at 5:41 am #70717Sam Bauers
ParticipantIt depends how many times that 1/10th of a second happens per second.
January 2, 2009 at 5:39 am #70716Sam Bauers
ParticipantThe same performance gain is achieved using the existing forum_time index.
January 2, 2009 at 5:37 am #70715chrishajer
ParticipantI think it’s cool that the index and the mini-plugin can improve on bbPress, but “severe performance issues” to me is not going from 0.0920 to 0.0005 seconds. That’s from 1/10 of a second to nearly nothing. But 1/10 second was “severe performance issues”?
Or, does this query from _ck_ just show a way to measure the improvement, where in actual usage, someone with 10K topics or 42K topics would see a performance hit (delay) much different than the test query that _ck_ posted. I’m all for improving what can be improved, but there are much larger issues to worry about than something that is taking 1/10th of a second. With bandwidth and browsers being what they are, the page isn’t going to load that quickly anyway, and adding 1/10 of a second to the processing time is not going to be noticeable to me.
January 2, 2009 at 5:34 am #70714_ck_
ParticipantVery nice. So it’s definitely proven to be way faster.
But another question is, how much space does a non-unique index on 42,000 rows take?
January 2, 2009 at 5:24 am #70713Sam Bauers
ParticipantHere’s the result on WordPress.com’s English support forum:
41,990 total rows
Showing rows 0 - 24 (25 total, Query took 0.0024 sec)
Showing rows 0 - 24 (25 total, Query took 0.0024 sec)
Showing rows 0 - 24 (25 total, Query took 0.0024 sec)
Showing rows 0 - 24 (25 total, Query took 0.0024 sec)
Showing rows 0 - 24 (25 total, Query took 0.0024 sec)
Showing rows 0 - 24 (25 total, Query took 0.2102 sec)
Showing rows 0 - 24 (25 total, Query took 0.2062 sec)
Showing rows 0 - 24 (25 total, Query took 0.2037 sec)
Showing rows 0 - 24 (25 total, Query took 0.2031 sec)
Showing rows 0 - 24 (25 total, Query took 0.2060 sec)January 2, 2009 at 4:17 am #70712_ck_
ParticipantI bet it only doubles the performance when it can sort in memory. Once it spills into a temporary disk sort, then you start seeing a more radical increase in performance between the forced index and not.
I should also point out the mini-plugin (and index) will also help on any forum/sub-forum page in addition to the front-page. So all that extra index storage is at least multi-purpose.
One way to boost this even further would be to ORDER BY the topic_last_post_id and then use the last_post_id as a UNIQUE index (key) since no two posts can have the same post_id (and no two topics can have the same last post_id). topic_time is not unique at all so it takes a tad longer for mysql to sort/larger index.
January 2, 2009 at 4:15 am #70711chrishajer
ParticipantWith 615 topics, .0095 vs .0044 (~twice as fast). This is MySQL 4.0.27.
January 2, 2009 at 4:09 am #70710_ck_
ParticipantWow that is very significant, thanks for sharing that!
January 2, 2009 at 4:05 am #70709johnhiler
MemberI added the index and installed the plugin (my bb_topics has 11,826 records).
The first query took 0.0005 sec. The second one took 0.0920 sec. That’s 184 times faster!
January 2, 2009 at 3:53 am #70708_ck_
ParticipantOne possible way to benchmark the performance is to run these two queries in phpmyadmin (via SQL tab)
SELECT SQL_NO_CACHE t.* FROM bb_topics AS t USE INDEX(topic_time) WHERE t.topic_status = '0' AND t.topic_sticky != '2' ORDER BY t.topic_time DESC LIMIT 25vs.
SELECT SQL_NO_CACHE t.* FROM bb_topics AS t WHERE t.topic_status = '0' AND t.topic_sticky != '2' ORDER BY t.topic_time DESC LIMIT 25On my setup the one with the forced index takes half the time of the one without, however we are talking 0.0026 sec vs 0.0013 sec so that is almost meaningless. What we need is someone with 10,000 topics and then you’ll know for certain.
January 2, 2009 at 3:52 am #70707chrishajer
ParticipantSo long as it doesn’t kill anything (error out), I’m fine with installing it. I can wait for the performance improvements (if there will be any.) My forum has only 600 or so topics right now.
January 2, 2009 at 3:29 am #70706_ck_
ParticipantShould work on both 0.9 and trunk.
Seems fine on my 0.9 and trunk.
Unfortunately I have too few topics to benchmark any significant performance increase since this is only helpful to more active forums (ie. > 1000 topics)
January 2, 2009 at 3:24 am #70705chrishajer
ParticipantWhat versions will that work on, _ck_?
January 2, 2009 at 2:54 am #70704_ck_
ParticipantNot extensively tested but this will do it without a core hack
(once
ALTER TABLE bb_topics ADD INDEX (topic_time)is done)<?php
/*
Plugin Name: Topic Time Index
*/
add_filter('get_latest_topics_join','topic_time_index',99999);
function topic_time_index($join) {return " $join USE INDEX(topic_time) ";}
?>January 2, 2009 at 2:18 am #70702John James Jacoby
KeymasterSeems maybe the core should be updated to work around this eh?
January 2, 2009 at 2:06 am #70701_ck_
ParticipantThis is the SQL query to use if others want to add such an index:
ALTER TABLE bb_topics ADD INDEX (topic_time)But that in itself is not enough, bbPress has to be forced to use the index.
I am trying to figure out a way to do this without hacking the core, via a mini-plugin instead.
-
AuthorSearch Results