<?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>抚琴居 &#187; Life</title> <atom:link href="http://yanbin.org/category/life/feed" rel="self" type="application/rss+xml" /><link>http://yanbin.org</link> <description>人虽不能要他想要的，但能做他想做的</description> <lastBuildDate>Thu, 11 Aug 2011 02:10:08 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.2</generator> <atom:link rel="hub" href="http://pubsubhubbub.appspot.com"/><atom:link rel="hub" href="http://superfeedr.com/hubbub"/> <item><title>终于折腾好了～</title><link>http://yanbin.org/archive/it-will-be-ok.html</link> <comments>http://yanbin.org/archive/it-will-be-ok.html#comments</comments> <pubDate>Tue, 08 May 2007 10:40:17 +0000</pubDate> <dc:creator>yAnbiN</dc:creator> <category><![CDATA[Life]]></category><guid isPermaLink="false">http://www.yAnbiN.org/2007/05/08/%e7%bb%88%e4%ba%8e%e6%8a%98%e8%85%be%e5%a5%bd%e4%ba%86%ef%bd%9e/</guid> <description><![CDATA[算起来这个站点都快有三个月打不开了。不过还好，在一些朋友的帮助下现在似乎是没什么大问题了。 尽管在这个 Blog 上有三个月的空白，但在实际生活中却并非如此。相反，这三个月经过的事情貌似比上一年加起来还多。当然，过去的已经过去，新的生活才刚刚开始～ 本年度剩余时间的打算： 完善一下现有的 PHP 反编译器，完成难度 4； 写一款较为完善的 PHP 加密工具，完成难度 5； 使用 Delphi 写一款 PHP 的 IDE，完成难度 7； 找一份合适的工作，完成难度 8； 找一个合适的MM，完成难度 10。：（]]></description> <content:encoded><![CDATA[<p>算起来这个站点都快有三个月打不开了。不过还好，在一些朋友的帮助下现在似乎是没什么大问题了。</p><p>尽管在这个 Blog 上有三个月的空白，但在实际生活中却并非如此。相反，这三个月经过的事情貌似比上一年加起来还多。当然，过去的已经过去，新的生活才刚刚开始～</p><p>本年度剩余时间的打算：</p><ol><li>完善一下现有的 PHP 反编译器，完成难度 4；</li><li>写一款较为完善的 PHP 加密工具，完成难度 5；</li><li>使用 Delphi 写一款 PHP 的 IDE，完成难度 7；</li><li>找一份合适的工作，完成难度 8；</li><li>找一个合适的MM，完成难度 10。：（</li></ol> ]]></content:encoded> <wfw:commentRss>http://yanbin.org/archive/it-will-be-ok.html/feed</wfw:commentRss> <slash:comments>5</slash:comments> </item> <item><title>一份关于不同版本的 PHP 在不同版本的 GCC 、ICC 编译条件下的基准测试报告及分析</title><link>http://yanbin.org/archive/php-gcc-icc-benchmark.html</link> <comments>http://yanbin.org/archive/php-gcc-icc-benchmark.html#comments</comments> <pubDate>Wed, 08 Nov 2006 09:54:58 +0000</pubDate> <dc:creator>yAnbiN</dc:creator> <category><![CDATA[Life]]></category> <category><![CDATA[PHP]]></category> <category><![CDATA[benchmark]]></category> <category><![CDATA[GCC]]></category> <category><![CDATA[ICC]]></category> <category><![CDATA[PHP 5.2]]></category><guid isPermaLink="false">http://www.yAnbiN.org/2006/11/08/php_gcc_icc_benchmark/</guid> <description><![CDATA[目前 PHP 的运行版本可谓是百花齐放，老一代有以 4.4.x 为代表的 PHP4 以性能独霸一方，新生代则有 PHP 5.0.x 和 PHP 5.1.x 为代表，以功能后来居上。现在又出了个 5.2.0 ，撇开“八字只有一撇”的 PHP6 不说，现存的这么多 PHP 版本的性能表现到底如何呢？有“好事者”通过 PHP 4.4.4/5.0.5/5.1.6/5.2.0 在 GCC3、GCC4 和 ICC9 中分别打开不同的优化选项，总共得到了 80 余种的 PHP 二进制版本。然后以 $PHP_SRC/Zend/bench.php 为测试脚本做了一系列的基准测试。测试结果很值得玩味。 根据 Sebastian Bergmann 提供的基准测试数据表明，在各个 PHP 版本之间，5.1 和 5.2 的速度明显要快于 5.0 和 4.4，前者的速度几乎是后者的两倍（执行时间越短越好）。无论是 GCC 还是 ICC ，打开优化(/On)后的性能也明显比不打开优化（/O0）高出一大截，也几乎是两倍的关系，而且在 PHP 5.1/5.2 身上效果更为突出。但具体的优化（O1、O2、O3、Os）之间性能差别不大，令人意外的是 PHP 5.1/5.2 的 Os [...]]]></description> <content:encoded><![CDATA[<p>目前 PHP 的运行版本可谓是百花齐放，老一代有以 4.4.x 为代表的 PHP4 以性能独霸一方，新生代则有 PHP 5.0.x 和 PHP 5.1.x 为代表，以功能后来居上。现在又出了个 5.2.0 ，撇开“八字只有一撇”的 PHP6 不说，现存的这么多 PHP 版本的性能表现到底如何呢？有“好事者”通过 PHP 4.4.4/5.0.5/5.1.6/5.2.0 在 GCC3、GCC4 和 ICC9 中分别打开不同的优化选项，总共得到了 80 余种的 PHP 二进制版本。然后以 $PHP_SRC/Zend/bench.php 为测试脚本做了一系列的基准测试。测试结果很值得玩味。</p><p>根据 <a href="http://sebastian-bergmann.de/" target="_blank" title="Sebastian Bergmann">Sebastian Bergmann</a> 提供的<a href="http://sebastian-bergmann.de/archives/634-PHP-GCC-ICC-Benchmark.html" target="_blank" title="PHP / GCC / ICC Benchmark">基准测试数据</a>表明，在各个 PHP 版本之间，5.1 和 5.2 的速度明显要快于 5.0 和 4.4，前者的速度几乎是后者的两倍（执行时间越短越好）。无论是 GCC 还是 ICC ，打开优化(/On)后的性能也明显比不打开优化（/O0）高出一大截，也几乎是两倍的关系，而且在 PHP 5.1/5.2 身上效果更为突出。但具体的优化（O1、O2、O3、Os）之间性能差别不大，令人意外的是 PHP 5.1/5.2 的 Os 优化反倒比 On 等差了很多。</p><p><img src="/wp-content/images/gcc346.png" border="0" alt="PHP 4.4.4, PHP 5.0.5, PHP 5.1.6, and PHP 5.2 built with GCC 3.4.6 and CFLAGS=&#39;-O{0|1|2|3|s}" title="PHP 4.4.4, PHP 5.0.5, PHP 5.1.6, and PHP 5.2 built with GCC 3.4.6 and CFLAGS=&#39;-O{0|1|2|3|s}" width="500" height="250" style="width: 500px; height: 250px" /></p><p><img src="/wp-content/images/gcc411.png" border="0" alt="PHP 4.4.4, PHP 5.0.5, PHP 5.1.6, and PHP 5.2 built with GCC 4.1.1 and CFLAGS=&#39;-O{0|1|2|3|s}" title="PHP 4.4.4, PHP 5.0.5, PHP 5.1.6, and PHP 5.2 built with GCC 4.1.1 and CFLAGS=&#39;-O{0|1|2|3|s}" width="500" height="250" style="width: 500px; height: 250px" />&nbsp;</p><p><img src="/wp-content/images/icc.png" border="0" alt="PHP 4.4.4, PHP 5.0.5, PHP 5.1.6, and PHP 5.2.0 built with ICC 9.1.042 and CFLAGS=&#39;-O{0|1|2|3|s}" title="PHP 4.4.4, PHP 5.0.5, PHP 5.1.6, and PHP 5.2.0 built with ICC 9.1.042 and CFLAGS=&#39;-O{0|1|2|3|s}" width="500" height="250" style="width: 500px; height: 250px" /></p><p>在编译器之间的比较方面，GCC3 和 GCC4 的性能并无太大差别，ICC9 的表现较 GCC 大约有 10% 左右的提升。</p><p><img src="/wp-content/images/gcc_vs_icc.png" border="0" alt="GCC 3.4.6 vs GCC 4.1.1 vs ICC 9.1.042 for PHP 4.4.4, PHP 5.0.5, PHP 5.1.6, and PHP 5.2.0" title="GCC 3.4.6 vs GCC 4.1.1 vs ICC 9.1.042 for PHP 4.4.4, PHP 5.0.5, PHP 5.1.6, and PHP 5.2.0" width="500" height="250" style="width: 500px; height: 250px" /></p><p>如何看待这些测试结果呢？</p><p>整体来看，似乎是 PHP 5.1/5.2 的速度完全占据了压倒性的优势。并且 5.1.6 的速度还要比 5.2.0 快那么一点点。这主要应归功于自 PHP 5.1 开始 Zend Engine 的虚拟机采用了新的基于 Call 调度而不是老式的那种基于 Switch 调度的执行器。这种改变主要是为了充分利用现代 CPU 已经普遍具有的超大缓存和多级流水线分支预测特性。目前来看效果是十分明显的。</p><p>PHP 5.1.6 和 5.2.0 的虚拟机基本上是相同的，既然这样，那为什么 5.1.6 会比 5.2.0 略快呢？原因就是其采用的内存管理器不同。在 PHP 5.2.0 中，Zend Engine 采用了一种类似内存池技术来管理内存。内存管理器通过 emalloc()/efree() 等接管对实际内存的申请和释放工作，在通过 efree() 释放时并不真正释放内存，而是将其放入到一个链表中，打上一个“可用”标记，下次再通过 emalloc() 申请时就先在这个“可用内存链表”检索，若有可用内存（即打有“可用”标记的内存）则直接返回，否则再真正申请。显然这一工作要比 5.1.0 之前那种仅仅是 molloc/free() 简单封装的 emalloc()/efree() 做的工作要多。因此速度慢些也就情有可原了。但是这种方法主要是用以改善 PHP 在高负载下表现的（具体优点请 google “内存池”），在这样的基准测试中是完全看不到这样做的好处的。</p><p>因此，我们应该这样看待这次的基准测试：基准测试（Benchmark）只是一种“基准的测试”。它仅能展示了在某种情况下 PHP 语言特性的表现，它无法展示 PHP 在各种真实世界中表现。它可以给我们做一份很重要的参考，但你应该根据实际情况合理采用。比如说 ICC 的表现要强于 GCC，但 PHP 开发团队采用的编译条件基本上都是 GCC + O2 + i386 ，那么在 ICC 中、或者在GCC 的 O3、-pentium_pro 的稳定性就还有待于时间的检验。此外若你负载压力较大或安全性要求较高，那 5.2 就比 5.1 相对要好。如果你的系统在 PHP4 上表现很好，而且没有太大负载，那就完全没有必要移植到 PHP5。当然，若果是全新的开发和部署，我还是向您推荐性能与稳定俱佳的 PHP 5.2.0。:)</p> ]]></content:encoded> <wfw:commentRss>http://yanbin.org/archive/php-gcc-icc-benchmark.html/feed</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>是否我消失了 你才会知道我的存在……</title><link>http://yanbin.org/archive/where-are-you.html</link> <comments>http://yanbin.org/archive/where-are-you.html#comments</comments> <pubDate>Sat, 25 Feb 2006 17:32:05 +0000</pubDate> <dc:creator>yAnbiN</dc:creator> <category><![CDATA[Life]]></category><guid isPermaLink="false"></guid> <description><![CDATA[从那一天起，我便告诉自己要忘记她。 于是，我尽我所能地做得坚强，努力在第 N 天只以 1/N 的概率想起她，那样，最终会有一天我能不再想她。 然而，即便如此，在未来我想起她的次数还是趋向于无穷大。]]></description> <content:encoded><![CDATA[<p id="where">从那一天起，我便告诉自己要忘记她。</p><p id="are">于是，我尽我所能地做得坚强，努力在第 N 天只以 1/N 的概率想起她，那样，最终会有一天我能不再想她。</p><p id="you">然而，即便如此，在未来我想起她的次数还是趋向于无穷大。</p> ]]></content:encoded> <wfw:commentRss>http://yanbin.org/archive/where-are-you.html/feed</wfw:commentRss> <slash:comments>0</slash:comments> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using apc
Page Caching using apc
Database Caching 4/12 queries in 0.004 seconds using apc
Object Caching 315/335 objects using apc
Content Delivery Network via N/A

Served from: yanbin.org @ 2012-05-19 00:16:42 -->
