<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Tuning &#8211; Harry Jackson</title>
	<atom:link href="http://127.0.0.1:8090/tag/tuning/feed" rel="self" type="application/rss+xml" />
	<link>http://127.0.0.1:8090</link>
	<description>Parent, Painter, Programmer</description>
	<lastBuildDate>Sat, 19 Nov 2005 22:25:21 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1</generator>
	<item>
		<title>perl -d:DProf</title>
		<link>http://127.0.0.1:8090/perl_ddprof.htm</link>
					<comments>http://127.0.0.1:8090/perl_ddprof.htm#respond</comments>
		
		<dc:creator><![CDATA[harry]]></dc:creator>
		<pubDate>Sat, 19 Nov 2005 22:25:21 +0000</pubDate>
				<category><![CDATA[Technical]]></category>
		<category><![CDATA[Optimization]]></category>
		<category><![CDATA[Perl]]></category>
		<category><![CDATA[Tuning]]></category>
		<guid isPermaLink="false">http://www.hjackson.org/wp/?p=296</guid>

					<description><![CDATA[I have been running a simple search engine tool on UKlug and I have noticed that things are getting a bit sluggish due to the amount of jobs in the database (300K+). Its not an astronomical amount but the method I am using is starting to strain against the hardware. I am going to rewrite &#8230; <p class="link-more"><a href="http://127.0.0.1:8090/perl_ddprof.htm" class="more-link">Continue reading<span class="screen-reader-text"> "perl -d:DProf"</span></a></p>]]></description>
										<content:encoded><![CDATA[<p>I have been running a simple search engine tool on <a href="http://www.uklug.co.uk">UKlug</a> and I have noticed that things are getting a bit sluggish due to the amount of jobs in the database (300K+). Its not an astronomical amount but the method I am using is starting to strain against the hardware. I am going to rewrite it (article for another day) but for now is there anything I could do to speed things up?<br />
When something just isn&#8217;t running as fast as expected then its time to break out the Perl profiler. The search engine has a mod_perl front end which is the first pain in the ass. I am fully conversant with <a href="http://perl.apache.org/docs/1.0/guide/performance.html">the mod_perl performance tuning</a> guide but trying to profile mod_perl is not as straight forward as the guide suggests.<br />
Luckily I always use modules for the bulk of the work on any cgi scripts so I created a mock script to call out to the modules and then ran the profiler against this as a stand alone program.</p>
<pre>
]$ perl -d:DProf mock_script.pl
</pre>
<p>This confirmed my suspicion that the main problem was database access. There are a couple of Perl functions that could be faster but tuning these when the database is such a bottle neck would be an exercise in futility. I know I have tuned the database to a point where it is not going to get any faster so everything is pointing at either a faster machine or a rewrite.<br />
It just so happens that I have a faster machine to hand so running the offending SQL with timings on I got the following times.<br />
Slow machine:<br />
Time: 3003.434 ms<br />
Fast Machine:<br />
Time: 1683.190 ms<br />
This is a marked improvement over the slower machine but it still a hellish time to wait for some results that have yet to be displayed. So how can I reduce the time taken to retrieve the results? More to follow.</p>
]]></content:encoded>
					
					<wfw:commentRss>http://127.0.0.1:8090/perl_ddprof.htm/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
