<?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>The Developer Day &#187; yii</title>
	<atom:link href="http://www.thedeveloperday.com/tag/yii/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.thedeveloperday.com</link>
	<description>Staying Curious</description>
	<lastBuildDate>Tue, 27 Jul 2010 17:33:37 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Benchmarks battle: Yii vs. Zend Framework</title>
		<link>http://www.thedeveloperday.com/framework-battles-yii-vs-zend-framework/</link>
		<comments>http://www.thedeveloperday.com/framework-battles-yii-vs-zend-framework/#comments</comments>
		<pubDate>Wed, 31 Dec 2008 12:43:51 +0000</pubDate>
		<dc:creator>Žilvinas Šaltys</dc:creator>
				<category><![CDATA[Frameworks]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[benchmark]]></category>
		<category><![CDATA[framework]]></category>
		<category><![CDATA[yii]]></category>
		<category><![CDATA[zend]]></category>

		<guid isPermaLink="false">http://www.thedeveloperday.com/framework-battles-yii-vs-zend-framework/</guid>
		<description><![CDATA[While browsing through planet-php.org like every morning I&#8217;ve found this blog post promoting Yii framework. Interested I took a look at Yii benchmarks page and got really surprised. To be honest benchmarking frameworks on a hello world application is a bit unfair. A hello world application requires very little complexity from the the framework. Zend Framework is [...]]]></description>
			<content:encoded><![CDATA[<p>While browsing through planet-php.org like every morning I&#8217;ve found this <a href="http://www.urdalen.com/blog/?p=307">blog post</a> promoting <a href="http://www.yiiframework.com/" title="yii framework">Yii framework</a>. Interested I took a look at <a href="http://www.yiiframework.com/performance" title="yyi performance benchmarks">Yii benchmarks page</a> and got really <strong>surprised</strong>.</p>
<p>To be honest benchmarking frameworks on a hello world application is a bit unfair. A hello world application requires very little complexity from the the framework. <a href="http://www.zendframework.com/" title="zend framework">Zend Framework</a> is a very powerful framework that has many strengths. A test should do something realistic. For example connecting to a database, having a configuration file, properly rendering a view, having a model to retrieve data, doing something with it, rendering a layout, trying some plugins or other components like pagination. It requires more work to do such applications, but that is a good way to do a fair benchmark.</p>
<p>Not related to benchmarking but I couldn&#8217;t help but notice that Yii benchamarks die in controller actions. It is not best the best thing to do. It does not allow the framework to completely shutdown and do whatever it has to do. For example executing post dispatcher methods.</p>
<p>The benchmarks say that Yii 1.0 is 800% faster with APC than ZendFramework 1.7.2. That is trully amazing. A huge difference. And.. I don&#8217;t really believe it is true. So let&#8217;s run the same benchmark on our own metal <img src='http://www.thedeveloperday.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>Let&#8217;s start with server configurations.</p>
<p><strong>Yii server</strong>:</p>
<p>Operating System: Red Hat Enterprise Linux Server release 5.2<br />
Web Server: Apache httpd 2.0.40<br />
PHP: 5.2.6, any non-essential extensions are disabled<br />
CPU: Dual Intel Xeon 3.2GHz<br />
Main Memory: 2GB<br />
Hard Drive: 73GB 15K RPM SCSI/SAS HDD</p>
<p><strong>Our server</strong>:</p>
<p>Operating System: CentOS 5.2<br />
Web Server: Apache/2.2.3 Default configuration<br />
PHP: PHP Version 5.2.6 Default configuration + APC<br />
CPU: Intel(R) Pentium(R) 4 CPU 3.00GHz<br />
Main Memory: 1GB<br />
Hard Drive: 250GB 7200 RPM SATA2</p>
<p>As you can see there is no big difference. Actually our server is slower <img src='http://www.thedeveloperday.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' />  Less CPU power, less RPMs on HDD, more not needed modules and extensions enabled, less memory.</p>
<p>I used the same APC settings as the Yii folks.</p>
<p>apc.enabled=1<br />
apc.shm_segments=1<br />
apc.optimization=0<br />
apc.shm_size=32<br />
apc.ttl=7200<br />
apc.user_ttl=7200<br />
apc.num_files_hint=1024<br />
apc.mmap_file_mask=/tmp/apc.XXXXXX<br />
apc.enable_cli=1<br />
apc.cache_by_default=1</p>
<p>I&#8217;ve downloaded Yii 1.0 and zend framework 1.7.2. I&#8217;ve setup the same applications the Yii folks provide. Except I&#8217;ve removed the die and replaced it with an echo. And changed the ZF bootstrap file to work in no view renderer mode. The bootstrap file looks like this:</p>
<pre name="code" class="php:nogutter">
set_include_path(dirname(__FILE__));
require_once 'Zend/Loader.php';
Zend_Loader::registerAutoload();$front = Zend_Controller_Front::getInstance();
$front->addControllerDirectory(dirname(__FILE__)."/application/controllers", 'default');
$front->setParam('noViewRenderer', true);
$front->dispatch();
</pre>
<p>And then I ran the same AB test: &#8220;ab -t 30 -c 10 URL&#8221; as the Yii guys. I also want to note that I ran the tests a few times to warm up the APC cache. Let&#8217;s look at the results:</p>
<ul>
<li><strong>Zend Framework 1.7.2</strong>: 184 RPS (requests per second)</li>
<li><strong>Yii 1.0:</strong> 275 RPS</li>
<li><strong>Yii 1.0 with yiilite.php</strong>: 235 RPS</li>
</ul>
<p>And now lets evalue these test results:</p>
<ol>
<li>Even on a slower machine ZendFramework is more than 3 times faster with APC than in the Yii benchmark. (strange)</li>
<li>In comparison Yii is not 800% faster than ZF like shown on the Yii benchmark page.</li>
</ol>
<p>It&#8217;s possible I&#8217;ve made a mistake somewhere. It would be nice to see more people testing this.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thedeveloperday.com/framework-battles-yii-vs-zend-framework/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
	</channel>
</rss>
