<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Investigating WordPress 2.0.4 Performance</title>
	<atom:link href="http://libertini.net/libertus/2006/08/wordpress-204-performance/feed/" rel="self" type="application/rss+xml" />
	<link>http://libertini.net/libertus/2006/08/wordpress-204-performance/</link>
	<description>Mature, refined and elegant. Almost, but not entirely unlike the geek equivalent of a good wine.</description>
	<lastBuildDate>Mon, 13 Apr 2009 08:18:18 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Libertus</title>
		<link>http://libertini.net/libertus/2006/08/wordpress-204-performance/comment-page-1/#comment-1343</link>
		<dc:creator>Libertus</dc:creator>
		<pubDate>Sat, 12 Aug 2006 11:21:58 +0000</pubDate>
		<guid isPermaLink="false">/libertus/2006/08/06/wordpress-204-performace/#comment-1343</guid>
		<description>&lt;h3&gt;Performance Probe Plugin&lt;/h3&gt;

Thanks to MarkJaquith on #wordpress for this freaky idea, which works! With a different one-line change to &lt;code&gt;do_action()&lt;/code&gt;, the performance probe becomes a plugin.

&lt;blockquote&gt;&lt;pre&gt;&lt;code&gt;function do_action($tag, $arg = &#039;&#039;) {
  if( $tag != &#039;do_action&#039; ) do_action( &#039;do_action&#039;, $tag );&lt;/code&gt;&lt;/pre&gt;&lt;/blockquote&gt;

I also experimented with a non-invasive plugin using &lt;code&gt;add_action( &#039;all&#039;, &#039;performance_probe&#039; );&lt;/code&gt; but this gets called for all &lt;em&gt;filters&lt;/em&gt; too and so generates too much information to be useful.</description>
		<content:encoded><![CDATA[<h3>Performance Probe Plugin</h3>
<p>Thanks to MarkJaquith on #wordpress for this freaky idea, which works! With a different one-line change to <code>do_action()</code>, the performance probe becomes a plugin.</p>
<blockquote><pre><code>function do_action($tag, $arg = '') {
  if( $tag != 'do_action' ) do_action( 'do_action', $tag );</code></pre>
</blockquote>
<p>I also experimented with a non-invasive plugin using <code>add_action( 'all', 'performance_probe' );</code> but this gets called for all <em>filters</em> too and so generates too much information to be useful.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Libertus</title>
		<link>http://libertini.net/libertus/2006/08/wordpress-204-performance/comment-page-1/#comment-1342</link>
		<dc:creator>Libertus</dc:creator>
		<pubDate>Sun, 06 Aug 2006 16:05:23 +0000</pubDate>
		<guid isPermaLink="false">/libertus/2006/08/06/wordpress-204-performace/#comment-1342</guid>
		<description>&lt;h3&gt;The &quot;Smiley&quot; Performance Monitor Plugin for WordPress&lt;/h3&gt;

Just for fun. Whilst activated, it puts a couple of smilies at the top-left of the page to indicate how hard WordPress had to work to make the page.

&lt;a href=&quot;/libertus/wordpress-plugins/#smiley-performance-monitor&quot;&gt;&quot;Smiley&quot; Peformance Monitor plugin for WordPress&lt;/a&gt;</description>
		<content:encoded><![CDATA[<h3>The &#8220;Smiley&#8221; Performance Monitor Plugin for WordPress</h3>
<p>Just for fun. Whilst activated, it puts a couple of smilies at the top-left of the page to indicate how hard WordPress had to work to make the page.</p>
<p><a href="/libertus/wordpress-plugins/#smiley-performance-monitor">&#8220;Smiley&#8221; Peformance Monitor plugin for WordPress</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Libertus</title>
		<link>http://libertini.net/libertus/2006/08/wordpress-204-performance/comment-page-1/#comment-1341</link>
		<dc:creator>Libertus</dc:creator>
		<pubDate>Sun, 06 Aug 2006 13:06:06 +0000</pubDate>
		<guid isPermaLink="false">/libertus/2006/08/06/wordpress-204-performace/#comment-1341</guid>
		<description>&lt;h3&gt;Upgrade Problem or Not?&lt;/h3&gt;

This probably isn&#039;t &lt;em&gt;the&lt;/em&gt; upgrade problem, but it is certainly a problem one might encounter upon upgrade to a version that contains this inefficient search code. Using the &lt;is:product from=&quot;http://trac.wordpress.org&quot;&gt;WordPress Trac&lt;/is:product&gt; I can browse the source looking back through the versions to find out in which the offending code was introduced.

&lt;dl&gt;
&lt;dt&gt;&lt;a href=&quot;http://trac.wordpress.org/browser/tags/2.0.4/wp-includes/classes.php&quot;&gt;2.0.4&lt;/a&gt;&lt;/dt&gt;&lt;dd&gt;Contains at &lt;a href=&quot;http://trac.wordpress.org/browser/tags/2.0.4/wp-includes/classes.php#L379&quot;&gt;line 379&lt;/a&gt;&lt;/dd&gt;
&lt;dt&gt;&lt;a href=&quot;http://trac.wordpress.org/browser/tags/2.0.3/wp-includes/classes.php&quot;&gt;2.0.3&lt;/a&gt;&lt;/dt&gt;&lt;dd&gt;Contains at &lt;a href=&quot;http://trac.wordpress.org/browser/tags/2.0.3/wp-includes/classes.php#L378&quot;&gt;line 378&lt;/a&gt;&lt;/dd&gt;
&lt;dt&gt;&lt;a href=&quot;http://trac.wordpress.org/browser/tags/2.0.2/wp-includes/classes.php&quot;&gt;2.0.2&lt;/a&gt;&lt;/dt&gt;&lt;dd&gt;Contains at &lt;a href=&quot;http://trac.wordpress.org/browser/tags/2.0.2/wp-includes/classes.php#L378&quot;&gt;line 378&lt;/a&gt;&lt;/dd&gt;
&lt;dt&gt;&lt;a href=&quot;http://trac.wordpress.org/browser/tags/2.0.1/wp-includes/classes.php&quot;&gt;2.0.1&lt;/a&gt;&lt;/dt&gt;&lt;dd&gt;Contains at &lt;a href=&quot;http://trac.wordpress.org/browser/tags/2.0.1/wp-includes/classes.php#L378&quot;&gt;line 378&lt;/a&gt;&lt;/dd&gt;
&lt;/dl&gt;

No, this isn&#039;t an upgrade problem &lt;em&gt;at all&lt;/em&gt;. It&#039;s just a problem my blog already has. :)</description>
		<content:encoded><![CDATA[<div id='outreach-1' class='outreach-control' title='outreach is available'>
<a class='outreach' href='/libertus/outreach/#help' title='help for outreach' rel='nofollow'>outreach</a>
<ul>
<li title='no outreach'><a href='http://libertini.net/libertus/2006/08/wordpress-204-performance/?outreach=none#outreach-1' rel='nofollow'>none</a></li>
<li title='balanced outreach (current)'>~</li>
</ul>
</div>
<h3>Upgrade Problem or Not?</h3>
<p>This probably isn&#8217;t <em>the</em> upgrade problem, but it is certainly a problem one might encounter upon upgrade to a version that contains this inefficient search code. Using the <is :product from="http://trac.wordpress.org"><a class='outreach' href='http://trac.wordpress.org'>WordPress Trac</a></is> I can browse the source looking back through the versions to find out in which the offending code was introduced.</p>
<dl>
<dt><a href="http://trac.wordpress.org/browser/tags/2.0.4/wp-includes/classes.php">2.0.4</a></dt>
<dd>Contains at <a href="http://trac.wordpress.org/browser/tags/2.0.4/wp-includes/classes.php#L379">line 379</a></dd>
<dt><a href="http://trac.wordpress.org/browser/tags/2.0.3/wp-includes/classes.php">2.0.3</a></dt>
<dd>Contains at <a href="http://trac.wordpress.org/browser/tags/2.0.3/wp-includes/classes.php#L378">line 378</a></dd>
<dt><a href="http://trac.wordpress.org/browser/tags/2.0.2/wp-includes/classes.php">2.0.2</a></dt>
<dd>Contains at <a href="http://trac.wordpress.org/browser/tags/2.0.2/wp-includes/classes.php#L378">line 378</a></dd>
<dt><a href="http://trac.wordpress.org/browser/tags/2.0.1/wp-includes/classes.php">2.0.1</a></dt>
<dd>Contains at <a href="http://trac.wordpress.org/browser/tags/2.0.1/wp-includes/classes.php#L378">line 378</a></dd>
</dl>
<p>No, this isn&#8217;t an upgrade problem <em>at all</em>. It&#8217;s just a problem my blog already has. <img src='http://libertini.net/libertus/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Libertus</title>
		<link>http://libertini.net/libertus/2006/08/wordpress-204-performance/comment-page-1/#comment-1337</link>
		<dc:creator>Libertus</dc:creator>
		<pubDate>Sun, 06 Aug 2006 11:29:28 +0000</pubDate>
		<guid isPermaLink="false">/libertus/2006/08/06/wordpress-204-performace/#comment-1337</guid>
		<description>&lt;h3&gt;Robert Deaton&#039;s Use Case&lt;/h3&gt;

On the &lt;is:product&gt;wp-hackers mailing list&lt;/is:product&gt;, 5&lt;sup&gt;th&lt;/sup&gt; August 2006 at 23:00, Robert Deaton described a particular use case in which slow-down occurs.

&lt;blockquote&gt;
I believe I have found part of the cause of the 2.0.4 performance
issues complaints. Somewhere between 2.0.3 and 2.0.4, we did something
that calls get_post tens to hundreds of times depending on the number
of pages when viewing a page with a permalink. This is now completely
reproducable, and is a serious concern as I have one client who is
getting in excess of 300 database queries per page view.

I haven&#039;t yet found the core cause of the issue, but to reproduce,
make sure you have a decent amount of pages (say at least 20 or so),
and fancy permalinks enabled, and likely some sort of menu listing the
pages on the sidebar (I believe this is where the issue is, the new
page walking code perhaps?). You should notice a considerable spike in
query usage, I haven&#039;t had a chance to dig around more, but the rest
of you are welcome to do so, imho this is big enough where it needs to
be fixed and maybe even one last release on the 2.0.x series before
2.1, as this could cause shared hosts to ban users easily for
hammering the db server.
&lt;/blockquote&gt;

&lt;h4&gt;Analysis&lt;/h4&gt;

The homepage isn&#039;t cited as being slow. This sounds like a single-page view with a sidebar, accessed by permalink.

Checking my test data, I don&#039;t have a decent number of pages (11), so I create 10 more. I do have fancy permalinks enabled and it&#039;s easy to make the Widget sidebar with page listing appear in the single-page view.

&lt;h4&gt;First Test&lt;/h4&gt;

I run the homepage then switch to a single page from the sidebar, which I reload a couple of times, after a bit of wrangling with &lt;code&gt;.htaccess&lt;/code&gt; to get the permalinks working. The results are interesting.

&lt;h5&gt;Homepage&lt;/h5&gt;
&lt;dl class=&quot;shell&quot;&gt;
&lt;dt&gt;paul@kubuntu ~/p/w/wp-content&gt; php dump.php perfgraph-20060806-125348&lt;/dt&gt;
&lt;dd&gt;0,plugins_loaded,3727104,3727104,0.138,2
1,sanitize_comment_cookies,3732064,4960,0.139,2
2,init,3798032,65968,0.147,2
3,set_current_user,3807472,9440,0.149,4
4,widgets_init,3816240,8768,0.159,4
5,pre_get_posts,3825864,9624,0.165,4
6,template_redirect,3968440,142576,0.207,8
7,wp_head,3980568,12128,0.210,8
8,loop_start,3974056,-6512,0.215,11
9,loop_end,3996240,22184,0.292,11
10,wp_meta,4008296,12056,0.297,12
11,parse_query,4022776,14480,0.302,14
12,pre_get_posts,4023192,416,0.302,14
13,loop_start,4067184,43992,0.307,17
14,loop_end,4067120,-64,0.321,17
15,wp_footer,4215728,148608,0.383,24
16,/~paul/wp-perftest/,4208296,-7432,0.383,24&lt;/dd&gt;
&lt;/dl&gt;

&lt;h5&gt;Single Page&lt;/h5&gt;
&lt;dl class=&quot;shell&quot;&gt;
&lt;dt&gt;paul@kubuntu ~/p/w/wp-content&gt; php dump.php perfgraph-20060806-125443&lt;/dt&gt;
&lt;dd&gt;0,plugins_loaded,3727472,3727472,0.104,2
1,sanitize_comment_cookies,3732856,5384,0.104,2
2,init,3798768,65912,0.108,2
3,set_current_user,3808208,9440,0.111,4
4,widgets_init,3816976,8768,0.119,4
5,parse_query,3819184,2208,0.123,4
6,pre_get_posts,3819632,448,0.123,4
7,template_redirect,4013528,193896,0.135,15
8,wp_head,4025792,12264,0.144,15
9,loop_start,4019304,-6488,0.146,18
10,loop_end,4028888,9584,0.194,18
11,wp_meta,4040152,11264,0.196,18
12,parse_query,4065184,25032,0.201,21
13,pre_get_posts,4065600,416,0.201,21
14,loop_start,4105600,40000,0.207,24
15,loop_end,4105704,104,0.220,24
16,wp_footer,4254632,148928,0.280,31
17,/~paul/wp-perftest/zeitgeist/,4249616,-5016,0.280,31&lt;/dd&gt;
&lt;/dl&gt;

&lt;h5&gt;Observations&lt;/h5&gt;

The number of queries for the page view is &lt;strong&gt;7 more&lt;/strong&gt; than for the homepage, for no obvious reason, which deserves further investigation. The page load time is not affected.

&lt;h4&gt;Investigation&lt;/h4&gt;

The extra 7 queries occur between action &lt;code&gt;pre_get_posts&lt;/code&gt; and action &lt;code&gt;template_redirect&lt;/code&gt;. Why does a single page view need so many more queries than the homepage? At a guess, I&#039;d say &lt;em&gt;security&lt;/em&gt; (there&#039;s an &quot;Edit this page&quot; link), but I can&#039;t account for 7 queries with that alone. Time to look in the code, down the &lt;code&gt;is_single()&lt;/code&gt;, &lt;code&gt;is_page()&lt;/code&gt; and &lt;code&gt;!is_home()&lt;/code&gt; paths, starting from &lt;code&gt;wp-includes/classes.php&lt;/code&gt;, function &lt;code&gt;WP_Query::get_posts()&lt;/code&gt;.

This yields a block of code, conditional on query parameter &lt;code&gt;pagename&lt;/code&gt;, containing a call to &lt;code&gt;get_all_page_ids()&lt;/code&gt; and a loop calling &lt;code&gt;get_page()&lt;/code&gt;. This loop appears to be the means by which the ID of the required single page is found. I can prove this by choosing a different page, perhaps one of the test pages I added, and see how many queries are performed, betting that it&#039;s no longer 7 more than the homepage.

&lt;dl class=&quot;shell&quot;&gt;
&lt;dt&gt;paul@kubuntu ~/p/w/wp-content&gt; php dump.php perfgraph-20060806-132515&lt;/dt&gt;
&lt;dd&gt;0,plugins_loaded,3727424,3727424,0.102,2
1,sanitize_comment_cookies,3732736,5312,0.102,2
2,init,3798672,65936,0.106,2
3,set_current_user,3808112,9440,0.108,4
4,widgets_init,3816880,8768,0.117,4
5,parse_query,3814704,-2176,0.119,4
6,pre_get_posts,3815248,544,0.119,4
&lt;strong&gt;7,template_redirect,4068240,252992,0.151,30&lt;/strong&gt;
8,wp_head,4078784,10544,0.154,30
9,loop_start,4071592,-7192,0.156,33
10,loop_end,4071640,48,0.157,33
11,wp_meta,4083384,11744,0.159,33
12,parse_query,4116720,33336,0.165,36
13,pre_get_posts,4117136,416,0.165,36
14,loop_start,4158400,41264,0.199,39
15,loop_end,4158504,104,0.213,39
16,wp_footer,4303872,145368,0.277,46
17,/~paul/wp-perftest/performance-test-rd-usecase-page-7/performance-test-rd-usecase-page-8/performance-test-rd-usecase-page-9/performance-test-rd-usecase-page-10/,4298856,-5016,0.277,46&lt;/dd&gt;
&lt;/dl&gt;

I think this illustrates the problem nicely. The linear page ID search algorithm is rather inefficient.</description>
		<content:encoded><![CDATA[<div id='outreach-2' class='outreach-control' title='outreach is available'>
<a class='outreach' href='/libertus/outreach/#help' title='help for outreach' rel='nofollow'>outreach</a>
<ul>
<li title='no outreach'><a href='http://libertini.net/libertus/2006/08/wordpress-204-performance/?outreach=none#outreach-2' rel='nofollow'>none</a></li>
<li title='balanced outreach (current)'>~</li>
</ul>
</div>
<h3>Robert Deaton&#8217;s Use Case</h3>
<p>On the <is :product><a class='outreach' href='http://www.google.com/search?btnI=I%27m+feeling+lucky&#038;q=wp-hackers+mailing+list'>wp-hackers mailing list</a></is>, 5<sup>th</sup> August 2006 at 23:00, Robert Deaton described a particular use case in which slow-down occurs.</p>
<blockquote><p>
I believe I have found part of the cause of the 2.0.4 performance<br />
issues complaints. Somewhere between 2.0.3 and 2.0.4, we did something<br />
that calls get_post tens to hundreds of times depending on the number<br />
of pages when viewing a page with a permalink. This is now completely<br />
reproducable, and is a serious concern as I have one client who is<br />
getting in excess of 300 database queries per page view.</p>
<p>I haven&#8217;t yet found the core cause of the issue, but to reproduce,<br />
make sure you have a decent amount of pages (say at least 20 or so),<br />
and fancy permalinks enabled, and likely some sort of menu listing the<br />
pages on the sidebar (I believe this is where the issue is, the new<br />
page walking code perhaps?). You should notice a considerable spike in<br />
query usage, I haven&#8217;t had a chance to dig around more, but the rest<br />
of you are welcome to do so, imho this is big enough where it needs to<br />
be fixed and maybe even one last release on the 2.0.x series before<br />
2.1, as this could cause shared hosts to ban users easily for<br />
hammering the db server.
</p></blockquote>
<h4>Analysis</h4>
<p>The homepage isn&#8217;t cited as being slow. This sounds like a single-page view with a sidebar, accessed by permalink.</p>
<p>Checking my test data, I don&#8217;t have a decent number of pages (11), so I create 10 more. I do have fancy permalinks enabled and it&#8217;s easy to make the Widget sidebar with page listing appear in the single-page view.</p>
<h4>First Test</h4>
<p>I run the homepage then switch to a single page from the sidebar, which I reload a couple of times, after a bit of wrangling with <code>.htaccess</code> to get the permalinks working. The results are interesting.</p>
<h5>Homepage</h5>
<dl class="shell">
<dt>paul@kubuntu ~/p/w/wp-content> php dump.php perfgraph-20060806-125348</dt>
<dd>0,plugins_loaded,3727104,3727104,0.138,2<br />
1,sanitize_comment_cookies,3732064,4960,0.139,2<br />
2,init,3798032,65968,0.147,2<br />
3,set_current_user,3807472,9440,0.149,4<br />
4,widgets_init,3816240,8768,0.159,4<br />
5,pre_get_posts,3825864,9624,0.165,4<br />
6,template_redirect,3968440,142576,0.207,8<br />
7,wp_head,3980568,12128,0.210,8<br />
8,loop_start,3974056,-6512,0.215,11<br />
9,loop_end,3996240,22184,0.292,11<br />
10,wp_meta,4008296,12056,0.297,12<br />
11,parse_query,4022776,14480,0.302,14<br />
12,pre_get_posts,4023192,416,0.302,14<br />
13,loop_start,4067184,43992,0.307,17<br />
14,loop_end,4067120,-64,0.321,17<br />
15,wp_footer,4215728,148608,0.383,24<br />
16,/~paul/wp-perftest/,4208296,-7432,0.383,24</dd>
</dl>
<h5>Single Page</h5>
<dl class="shell">
<dt>paul@kubuntu ~/p/w/wp-content> php dump.php perfgraph-20060806-125443</dt>
<dd>0,plugins_loaded,3727472,3727472,0.104,2<br />
1,sanitize_comment_cookies,3732856,5384,0.104,2<br />
2,init,3798768,65912,0.108,2<br />
3,set_current_user,3808208,9440,0.111,4<br />
4,widgets_init,3816976,8768,0.119,4<br />
5,parse_query,3819184,2208,0.123,4<br />
6,pre_get_posts,3819632,448,0.123,4<br />
7,template_redirect,4013528,193896,0.135,15<br />
8,wp_head,4025792,12264,0.144,15<br />
9,loop_start,4019304,-6488,0.146,18<br />
10,loop_end,4028888,9584,0.194,18<br />
11,wp_meta,4040152,11264,0.196,18<br />
12,parse_query,4065184,25032,0.201,21<br />
13,pre_get_posts,4065600,416,0.201,21<br />
14,loop_start,4105600,40000,0.207,24<br />
15,loop_end,4105704,104,0.220,24<br />
16,wp_footer,4254632,148928,0.280,31<br />
17,/~paul/wp-perftest/zeitgeist/,4249616,-5016,0.280,31</dd>
</dl>
<h5>Observations</h5>
<p>The number of queries for the page view is <strong>7 more</strong> than for the homepage, for no obvious reason, which deserves further investigation. The page load time is not affected.</p>
<h4>Investigation</h4>
<p>The extra 7 queries occur between action <code>pre_get_posts</code> and action <code>template_redirect</code>. Why does a single page view need so many more queries than the homepage? At a guess, I&#8217;d say <em>security</em> (there&#8217;s an &#8220;Edit this page&#8221; link), but I can&#8217;t account for 7 queries with that alone. Time to look in the code, down the <code>is_single()</code>, <code>is_page()</code> and <code>!is_home()</code> paths, starting from <code>wp-includes/classes.php</code>, function <code>WP_Query::get_posts()</code>.</p>
<p>This yields a block of code, conditional on query parameter <code>pagename</code>, containing a call to <code>get_all_page_ids()</code> and a loop calling <code>get_page()</code>. This loop appears to be the means by which the ID of the required single page is found. I can prove this by choosing a different page, perhaps one of the test pages I added, and see how many queries are performed, betting that it&#8217;s no longer 7 more than the homepage.</p>
<dl class="shell">
<dt>paul@kubuntu ~/p/w/wp-content> php dump.php perfgraph-20060806-132515</dt>
<dd>0,plugins_loaded,3727424,3727424,0.102,2<br />
1,sanitize_comment_cookies,3732736,5312,0.102,2<br />
2,init,3798672,65936,0.106,2<br />
3,set_current_user,3808112,9440,0.108,4<br />
4,widgets_init,3816880,8768,0.117,4<br />
5,parse_query,3814704,-2176,0.119,4<br />
6,pre_get_posts,3815248,544,0.119,4<br />
<strong>7,template_redirect,4068240,252992,0.151,30</strong><br />
8,wp_head,4078784,10544,0.154,30<br />
9,loop_start,4071592,-7192,0.156,33<br />
10,loop_end,4071640,48,0.157,33<br />
11,wp_meta,4083384,11744,0.159,33<br />
12,parse_query,4116720,33336,0.165,36<br />
13,pre_get_posts,4117136,416,0.165,36<br />
14,loop_start,4158400,41264,0.199,39<br />
15,loop_end,4158504,104,0.213,39<br />
16,wp_footer,4303872,145368,0.277,46<br />
17,/~paul/wp-perftest/performance-test-rd-usecase-page-7/performance-test-rd-usecase-page-8/performance-test-rd-usecase-page-9/performance-test-rd-usecase-page-10/,4298856,-5016,0.277,46</dd>
</dl>
<p>I think this illustrates the problem nicely. The linear page ID search algorithm is rather inefficient.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Libertus</title>
		<link>http://libertini.net/libertus/2006/08/wordpress-204-performance/comment-page-1/#comment-1339</link>
		<dc:creator>Libertus</dc:creator>
		<pubDate>Sun, 06 Aug 2006 11:14:29 +0000</pubDate>
		<guid isPermaLink="false">/libertus/2006/08/06/wordpress-204-performace/#comment-1339</guid>
		<description>&lt;h3&gt;WordPress 2.0.4 Performance&lt;/h3&gt;

First, I reappy the performance probe change to &lt;code&gt;index.php&lt;/code&gt; and &lt;code&gt;wp-includes/functions.php&lt;/code&gt;. Next, I view the test site. There is no perceptible performance difference, but I notice the widget changes need to be reapplied to the theme.

That done, and a few more reloads, there is still no perceptible performance difference. Now, I can&#039;t say I&#039;m able to notice differences when performance is already in the sub-second range, so what to the numbers say?

&lt;dl class=&quot;shell&quot;&gt;
&lt;dt&gt;paul@kubuntu ~/p/w/wp-content&gt; php dump.php perfgraph-20060806-122136&lt;/dt&gt;
&lt;dd&gt;0,plugins_loaded,3710856,3710856,0.106,2
1,sanitize_comment_cookies,3715736,4880,0.107,2
2,init,3781672,65936,0.111,2
3,set_current_user,3791112,9440,0.113,4
4,widgets_init,3799880,8768,0.121,4
5,pre_get_posts,3787704,-12176,0.125,4
6,template_redirect,3930560,142856,0.160,8
7,wp_head,3942688,12128,0.163,8
8,loop_start,3936176,-6512,0.165,11
9,loop_end,3959992,23816,0.237,11
10,wp_meta,3972048,12056,0.242,12
11,parse_query,3986528,14480,0.246,14
12,pre_get_posts,3986944,416,0.247,14
13,loop_start,4030936,43992,0.258,17
14,loop_end,4030872,-64,0.273,17
15,wp_footer,4152736,121864,0.322,24
16,/~paul/wp-perftest/,4145304,-7432,0.322,24&lt;/dd&gt;
&lt;dt&gt;paul@kubuntu ~/p/w/wp-content&gt; php dump.php perfgraph-20060806-122145&lt;/dt&gt;
&lt;dd&gt;0,plugins_loaded,3710856,3710856,0.108,2
1,sanitize_comment_cookies,3715736,4880,0.108,2
2,init,3781672,65936,0.112,2
3,set_current_user,3791112,9440,0.114,4
4,widgets_init,3799880,8768,0.122,4
5,pre_get_posts,3787704,-12176,0.126,4
6,template_redirect,3930560,142856,0.137,8
7,wp_head,3942688,12128,0.140,8
8,loop_start,3936176,-6512,0.142,11
9,loop_end,3959992,23816,0.214,11
10,wp_meta,3972048,12056,0.216,12
11,parse_query,3986528,14480,0.225,14
12,pre_get_posts,3986944,416,0.225,14
13,loop_start,4030936,43992,0.231,17
14,loop_end,4030872,-64,0.245,17
15,wp_footer,4152736,121864,0.293,24
16,/~paul/wp-perftest/,4145304,-7432,0.293,24&lt;/dd&gt;
&lt;dt&gt;paul@kubuntu ~/p/w/wp-content&gt; php dump.php perfgraph-20060806-122148&lt;/dt&gt;
&lt;dd&gt;0,plugins_loaded,3710856,3710856,0.106,2
1,sanitize_comment_cookies,3715736,4880,0.107,2
2,init,3781672,65936,0.111,2
3,set_current_user,3791112,9440,0.113,4
4,widgets_init,3799880,8768,0.126,4
5,pre_get_posts,3787704,-12176,0.129,4
6,template_redirect,3930560,142856,0.136,8
7,wp_head,3942688,12128,0.139,8
8,loop_start,3936176,-6512,0.142,11
9,loop_end,3959992,23816,0.220,11
10,wp_meta,3972048,12056,0.223,12
11,parse_query,3986528,14480,0.227,14
12,pre_get_posts,3986944,416,0.227,14
13,loop_start,4030936,43992,0.232,17
14,loop_end,4030872,-64,0.246,17
15,wp_footer,4152736,121864,0.298,24
16,/~paul/wp-perftest/,4145304,-7432,0.298,24&lt;/dd&gt;
&lt;/dl&gt;

&lt;em&gt;Nothing&lt;/em&gt;. The homepage hasn&#039;t slowed down. So, move on to a specific use case.</description>
		<content:encoded><![CDATA[<h3>WordPress 2.0.4 Performance</h3>
<p>First, I reappy the performance probe change to <code>index.php</code> and <code>wp-includes/functions.php</code>. Next, I view the test site. There is no perceptible performance difference, but I notice the widget changes need to be reapplied to the theme.</p>
<p>That done, and a few more reloads, there is still no perceptible performance difference. Now, I can&#8217;t say I&#8217;m able to notice differences when performance is already in the sub-second range, so what to the numbers say?</p>
<dl class="shell">
<dt>paul@kubuntu ~/p/w/wp-content> php dump.php perfgraph-20060806-122136</dt>
<dd>0,plugins_loaded,3710856,3710856,0.106,2<br />
1,sanitize_comment_cookies,3715736,4880,0.107,2<br />
2,init,3781672,65936,0.111,2<br />
3,set_current_user,3791112,9440,0.113,4<br />
4,widgets_init,3799880,8768,0.121,4<br />
5,pre_get_posts,3787704,-12176,0.125,4<br />
6,template_redirect,3930560,142856,0.160,8<br />
7,wp_head,3942688,12128,0.163,8<br />
8,loop_start,3936176,-6512,0.165,11<br />
9,loop_end,3959992,23816,0.237,11<br />
10,wp_meta,3972048,12056,0.242,12<br />
11,parse_query,3986528,14480,0.246,14<br />
12,pre_get_posts,3986944,416,0.247,14<br />
13,loop_start,4030936,43992,0.258,17<br />
14,loop_end,4030872,-64,0.273,17<br />
15,wp_footer,4152736,121864,0.322,24<br />
16,/~paul/wp-perftest/,4145304,-7432,0.322,24</dd>
<dt>paul@kubuntu ~/p/w/wp-content> php dump.php perfgraph-20060806-122145</dt>
<dd>0,plugins_loaded,3710856,3710856,0.108,2<br />
1,sanitize_comment_cookies,3715736,4880,0.108,2<br />
2,init,3781672,65936,0.112,2<br />
3,set_current_user,3791112,9440,0.114,4<br />
4,widgets_init,3799880,8768,0.122,4<br />
5,pre_get_posts,3787704,-12176,0.126,4<br />
6,template_redirect,3930560,142856,0.137,8<br />
7,wp_head,3942688,12128,0.140,8<br />
8,loop_start,3936176,-6512,0.142,11<br />
9,loop_end,3959992,23816,0.214,11<br />
10,wp_meta,3972048,12056,0.216,12<br />
11,parse_query,3986528,14480,0.225,14<br />
12,pre_get_posts,3986944,416,0.225,14<br />
13,loop_start,4030936,43992,0.231,17<br />
14,loop_end,4030872,-64,0.245,17<br />
15,wp_footer,4152736,121864,0.293,24<br />
16,/~paul/wp-perftest/,4145304,-7432,0.293,24</dd>
<dt>paul@kubuntu ~/p/w/wp-content> php dump.php perfgraph-20060806-122148</dt>
<dd>0,plugins_loaded,3710856,3710856,0.106,2<br />
1,sanitize_comment_cookies,3715736,4880,0.107,2<br />
2,init,3781672,65936,0.111,2<br />
3,set_current_user,3791112,9440,0.113,4<br />
4,widgets_init,3799880,8768,0.126,4<br />
5,pre_get_posts,3787704,-12176,0.129,4<br />
6,template_redirect,3930560,142856,0.136,8<br />
7,wp_head,3942688,12128,0.139,8<br />
8,loop_start,3936176,-6512,0.142,11<br />
9,loop_end,3959992,23816,0.220,11<br />
10,wp_meta,3972048,12056,0.223,12<br />
11,parse_query,3986528,14480,0.227,14<br />
12,pre_get_posts,3986944,416,0.227,14<br />
13,loop_start,4030936,43992,0.232,17<br />
14,loop_end,4030872,-64,0.246,17<br />
15,wp_footer,4152736,121864,0.298,24<br />
16,/~paul/wp-perftest/,4145304,-7432,0.298,24</dd>
</dl>
<p><em>Nothing</em>. The homepage hasn&#8217;t slowed down. So, move on to a specific use case.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Libertus</title>
		<link>http://libertini.net/libertus/2006/08/wordpress-204-performance/comment-page-1/#comment-1338</link>
		<dc:creator>Libertus</dc:creator>
		<pubDate>Sun, 06 Aug 2006 11:11:58 +0000</pubDate>
		<guid isPermaLink="false">/libertus/2006/08/06/wordpress-204-performace/#comment-1338</guid>
		<description>&lt;h3&gt;Upgrade to WordPress 2.0.4&lt;/h3&gt;

Copy the files, which disables the performance probes. There&#039;s no need to run the upgrade script (the database schema has not changed), and I&#039;m not asked to, but I do anyway.</description>
		<content:encoded><![CDATA[<h3>Upgrade to WordPress 2.0.4</h3>
<p>Copy the files, which disables the performance probes. There&#8217;s no need to run the upgrade script (the database schema has not changed), and I&#8217;m not asked to, but I do anyway.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Libertus</title>
		<link>http://libertini.net/libertus/2006/08/wordpress-204-performance/comment-page-1/#comment-1340</link>
		<dc:creator>Libertus</dc:creator>
		<pubDate>Sun, 06 Aug 2006 11:06:36 +0000</pubDate>
		<guid isPermaLink="false">/libertus/2006/08/06/wordpress-204-performace/#comment-1340</guid>
		<description>&lt;h3&gt;WordPress 2.0.3 Performance&lt;/h3&gt;

&lt;h4&gt;Non-widget Theme&lt;/h4&gt;
My first tests with the default, non-widgetized theme, are as follows:

&lt;dl class=&quot;shell&quot;&gt;
&lt;dt&gt;paul@kubuntu ~/p/w/wp-content&gt; php dump.php perfgraph-20060806-114525&lt;/dt&gt;
&lt;dd&gt;0,plugins_loaded,3384120,3384120,0.096,2
1,init,3453264,69144,0.100,2
2,set_current_user,3463160,9896,0.102,4
3,pre_get_posts,3450648,-12512,0.105,4
4,template_redirect,3589808,139160,0.136,8
5,wp_head,3603096,13288,0.139,8
6,loop_start,3594464,-8632,0.142,11
7,loop_end,3618680,24216,0.214,11
8,wp_meta,3754464,135784,0.269,19
9,wp_footer,3746200,-8264,0.270,19
10,/~paul/wp-perftest/,3739408,-6792,0.270,19&lt;/dd&gt;
&lt;dt&gt;paul@kubuntu ~/p/w/wp-content&gt; php dump.php perfgraph-20060806-114529&lt;/dt&gt;
&lt;dd&gt;0,plugins_loaded,3384120,3384120,0.095,2
1,init,3453264,69144,0.099,2
2,set_current_user,3463160,9896,0.101,4
3,pre_get_posts,3450856,-12304,0.106,4
4,template_redirect,3589960,139104,0.112,8
5,wp_head,3603248,13288,0.116,8
6,loop_start,3594616,-8632,0.123,11
7,loop_end,3618752,24136,0.191,11
8,wp_meta,3754536,135784,0.244,19
9,wp_footer,3746272,-8264,0.245,19
10,/~paul/wp-perftest/,3739480,-6792,0.245,19&lt;/dd&gt;
&lt;dt&gt;paul@kubuntu ~/p/w/wp-content&gt; php dump.php perfgraph-20060806-114533&lt;/dt&gt;
&lt;dd&gt;0,plugins_loaded,3384120,3384120,0.094,2
1,init,3453264,69144,0.098,2
2,set_current_user,3463160,9896,0.100,4
3,pre_get_posts,3450648,-12512,0.103,4
4,template_redirect,3589808,139160,0.109,8
5,wp_head,3603096,13288,0.113,8
6,loop_start,3594464,-8632,0.115,11
7,loop_end,3618680,24216,0.187,11
8,wp_meta,3754464,135784,0.240,19
9,wp_footer,3746200,-8264,0.242,19
10,/~paul/wp-perftest/,3739408,-6792,0.242,19&lt;/dd&gt;
&lt;/dl&gt;

The test homepage uses &lt;strong&gt;19 database queries&lt;/strong&gt; and renders in roughly &lt;strong&gt;0.25 seconds&lt;/strong&gt;.

&lt;h4&gt;Add Widgets&lt;/h4&gt;

I use the &quot;Recent Comments&quot; and &quot;Recent Posts&quot; widgets, both of which require database queries, so test with these activated is important.

&lt;dl class=&quot;shell&quot;&gt;
&lt;dt&gt;paul@kubuntu ~/p/w/wp-content&gt; php dump.php perfgraph-20060806-120442&lt;/dt&gt;
&lt;dd&gt;0,plugins_loaded,3635240,3635240,0.121,2
1,init,3719480,84240,0.126,2
2,set_current_user,3719304,-176,0.128,4
3,widgets_init,3737760,18456,0.182,4
4,pre_get_posts,3719808,-17952,0.187,4
5,template_redirect,3854496,134688,0.221,8
6,wp_head,3868008,13512,0.225,8
7,loop_start,3859376,-8632,0.229,11
8,loop_end,3883384,24008,0.316,11
9,wp_meta,3896848,13464,0.322,12
10,parse_query,3910552,13704,0.327,14
11,pre_get_posts,3910968,416,0.327,14
12,loop_start,3954648,43680,0.331,17
13,loop_end,3954672,24,0.349,17
14,wp_footer,4076424,121752,0.408,24
15,/~paul/wp-perftest/,4069184,-7240,0.408,24&lt;/dd&gt;
&lt;dt&gt;paul@kubuntu ~/p/w/wp-content&gt; php dump.php perfgraph-20060806-120449&lt;/dt&gt;
&lt;dd&gt;0,plugins_loaded,3635328,3635328,0.101,2
1,init,3719656,84328,0.105,2
2,set_current_user,3719480,-176,0.107,4
3,widgets_init,3737936,18456,0.147,4
4,pre_get_posts,3719728,-18208,0.151,4
5,template_redirect,3854520,134792,0.157,8
6,wp_head,3868032,13512,0.161,8
7,loop_start,3859400,-8632,0.163,11
8,loop_end,3883488,24088,0.237,11
9,wp_meta,3896952,13464,0.240,12
10,parse_query,3910656,13704,0.244,14
11,pre_get_posts,3911072,416,0.244,14
12,loop_start,3954752,43680,0.250,17
13,loop_end,3954776,24,0.268,17
14,wp_footer,4076528,121752,0.315,24
15,/~paul/wp-perftest/,4069288,-7240,0.315,24&lt;/dd&gt;
&lt;dt&gt;paul@kubuntu ~/p/w/wp-content&gt; php dump.php perfgraph-20060806-120452&lt;/dt&gt;
&lt;dd&gt;0,plugins_loaded,3635328,3635328,0.103,2
1,init,3719656,84328,0.107,2
2,set_current_user,3719480,-176,0.110,4
3,widgets_init,3737936,18456,0.146,4
4,pre_get_posts,3719728,-18208,0.154,4
5,template_redirect,3854520,134792,0.160,8
6,wp_head,3868032,13512,0.164,8
7,loop_start,3859400,-8632,0.167,11
8,loop_end,3883488,24088,0.234,11
9,wp_meta,3896952,13464,0.237,12
10,parse_query,3910656,13704,0.241,14
11,pre_get_posts,3911072,416,0.241,14
12,loop_start,3954752,43680,0.246,17
13,loop_end,3954776,24,0.265,17
14,wp_footer,4076528,121752,0.313,24
15,/~paul/wp-perftest/,4069288,-7240,0.313,24&lt;/dd&gt;
&lt;/dl&gt;

As expected, Widgets on the homepage cause it to use more queries and load slower, but not by any excessive amount - &lt;strong&gt;5 more queries&lt;/strong&gt; and &lt;strong&gt;0.06 seconds longer&lt;/strong&gt;.</description>
		<content:encoded><![CDATA[<h3>WordPress 2.0.3 Performance</h3>
<h4>Non-widget Theme</h4>
<p>My first tests with the default, non-widgetized theme, are as follows:</p>
<dl class="shell">
<dt>paul@kubuntu ~/p/w/wp-content> php dump.php perfgraph-20060806-114525</dt>
<dd>0,plugins_loaded,3384120,3384120,0.096,2<br />
1,init,3453264,69144,0.100,2<br />
2,set_current_user,3463160,9896,0.102,4<br />
3,pre_get_posts,3450648,-12512,0.105,4<br />
4,template_redirect,3589808,139160,0.136,8<br />
5,wp_head,3603096,13288,0.139,8<br />
6,loop_start,3594464,-8632,0.142,11<br />
7,loop_end,3618680,24216,0.214,11<br />
8,wp_meta,3754464,135784,0.269,19<br />
9,wp_footer,3746200,-8264,0.270,19<br />
10,/~paul/wp-perftest/,3739408,-6792,0.270,19</dd>
<dt>paul@kubuntu ~/p/w/wp-content> php dump.php perfgraph-20060806-114529</dt>
<dd>0,plugins_loaded,3384120,3384120,0.095,2<br />
1,init,3453264,69144,0.099,2<br />
2,set_current_user,3463160,9896,0.101,4<br />
3,pre_get_posts,3450856,-12304,0.106,4<br />
4,template_redirect,3589960,139104,0.112,8<br />
5,wp_head,3603248,13288,0.116,8<br />
6,loop_start,3594616,-8632,0.123,11<br />
7,loop_end,3618752,24136,0.191,11<br />
8,wp_meta,3754536,135784,0.244,19<br />
9,wp_footer,3746272,-8264,0.245,19<br />
10,/~paul/wp-perftest/,3739480,-6792,0.245,19</dd>
<dt>paul@kubuntu ~/p/w/wp-content> php dump.php perfgraph-20060806-114533</dt>
<dd>0,plugins_loaded,3384120,3384120,0.094,2<br />
1,init,3453264,69144,0.098,2<br />
2,set_current_user,3463160,9896,0.100,4<br />
3,pre_get_posts,3450648,-12512,0.103,4<br />
4,template_redirect,3589808,139160,0.109,8<br />
5,wp_head,3603096,13288,0.113,8<br />
6,loop_start,3594464,-8632,0.115,11<br />
7,loop_end,3618680,24216,0.187,11<br />
8,wp_meta,3754464,135784,0.240,19<br />
9,wp_footer,3746200,-8264,0.242,19<br />
10,/~paul/wp-perftest/,3739408,-6792,0.242,19</dd>
</dl>
<p>The test homepage uses <strong>19 database queries</strong> and renders in roughly <strong>0.25 seconds</strong>.</p>
<h4>Add Widgets</h4>
<p>I use the &#8220;Recent Comments&#8221; and &#8220;Recent Posts&#8221; widgets, both of which require database queries, so test with these activated is important.</p>
<dl class="shell">
<dt>paul@kubuntu ~/p/w/wp-content> php dump.php perfgraph-20060806-120442</dt>
<dd>0,plugins_loaded,3635240,3635240,0.121,2<br />
1,init,3719480,84240,0.126,2<br />
2,set_current_user,3719304,-176,0.128,4<br />
3,widgets_init,3737760,18456,0.182,4<br />
4,pre_get_posts,3719808,-17952,0.187,4<br />
5,template_redirect,3854496,134688,0.221,8<br />
6,wp_head,3868008,13512,0.225,8<br />
7,loop_start,3859376,-8632,0.229,11<br />
8,loop_end,3883384,24008,0.316,11<br />
9,wp_meta,3896848,13464,0.322,12<br />
10,parse_query,3910552,13704,0.327,14<br />
11,pre_get_posts,3910968,416,0.327,14<br />
12,loop_start,3954648,43680,0.331,17<br />
13,loop_end,3954672,24,0.349,17<br />
14,wp_footer,4076424,121752,0.408,24<br />
15,/~paul/wp-perftest/,4069184,-7240,0.408,24</dd>
<dt>paul@kubuntu ~/p/w/wp-content> php dump.php perfgraph-20060806-120449</dt>
<dd>0,plugins_loaded,3635328,3635328,0.101,2<br />
1,init,3719656,84328,0.105,2<br />
2,set_current_user,3719480,-176,0.107,4<br />
3,widgets_init,3737936,18456,0.147,4<br />
4,pre_get_posts,3719728,-18208,0.151,4<br />
5,template_redirect,3854520,134792,0.157,8<br />
6,wp_head,3868032,13512,0.161,8<br />
7,loop_start,3859400,-8632,0.163,11<br />
8,loop_end,3883488,24088,0.237,11<br />
9,wp_meta,3896952,13464,0.240,12<br />
10,parse_query,3910656,13704,0.244,14<br />
11,pre_get_posts,3911072,416,0.244,14<br />
12,loop_start,3954752,43680,0.250,17<br />
13,loop_end,3954776,24,0.268,17<br />
14,wp_footer,4076528,121752,0.315,24<br />
15,/~paul/wp-perftest/,4069288,-7240,0.315,24</dd>
<dt>paul@kubuntu ~/p/w/wp-content> php dump.php perfgraph-20060806-120452</dt>
<dd>0,plugins_loaded,3635328,3635328,0.103,2<br />
1,init,3719656,84328,0.107,2<br />
2,set_current_user,3719480,-176,0.110,4<br />
3,widgets_init,3737936,18456,0.146,4<br />
4,pre_get_posts,3719728,-18208,0.154,4<br />
5,template_redirect,3854520,134792,0.160,8<br />
6,wp_head,3868032,13512,0.164,8<br />
7,loop_start,3859400,-8632,0.167,11<br />
8,loop_end,3883488,24088,0.234,11<br />
9,wp_meta,3896952,13464,0.237,12<br />
10,parse_query,3910656,13704,0.241,14<br />
11,pre_get_posts,3911072,416,0.241,14<br />
12,loop_start,3954752,43680,0.246,17<br />
13,loop_end,3954776,24,0.265,17<br />
14,wp_footer,4076528,121752,0.313,24<br />
15,/~paul/wp-perftest/,4069288,-7240,0.313,24</dd>
</dl>
<p>As expected, Widgets on the homepage cause it to use more queries and load slower, but not by any excessive amount &#8211; <strong>5 more queries</strong> and <strong>0.06 seconds longer</strong>.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
