<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-3147036244016021082</id><updated>2023-06-05T21:37:24.538+08:00</updated><category term="Linux"/><category term="Vim"/><category term="Perl"/><category term="CPAN"/><category term="Php"/><category term="Life"/><category term="Git"/><category term="Module"/><category term="Emacs"/><category term="Lyrics"/><category term="Music"/><category term="Quote"/><category term="別人的詩"/><category term="Blogger"/><category term="Javascript"/><category term="Jifty"/><category term="Version-control-system"/><category term="svk"/><category term="En"/><category term="Haskell"/><category term="Mac"/><category term="閱讀"/><category term="Clip"/><category term="Golang"/><category term="Pear"/><category term="Skateboarding"/><category term="鋼琴"/><category term="Compiler"/><category term="Fw"/><category term="Link"/><category term="Movie"/><category term="Onion"/><category term="Router"/><category term="Web"/><category term="jit"/><category term="中華電信"/><category term="詩"/><category term="API"/><category term="Asm"/><category term="Bash"/><category term="CSS"/><category term="Firefox Extension"/><category term="Kernel"/><category term="Mac OS"/><category term="Makefile"/><category term="Mercurial"/><category term="News"/><category term="OpenGL"/><category term="Plack"/><category term="SASS"/><category term="This"/><category term="Zend VM"/><category term="c"/><category term="v8"/><category term="zsh"/><category term="交通手札"/><category term="字型"/><category term="軟體"/><category term="音樂"/><category term="Access 97"/><category term="AnyEvent"/><category term="Apple"/><category term="Bossa nova"/><category term="Bug Tracking System"/><category term="C++"/><category term="CLI"/><category term="Cairo"/><category term="Cocoa"/><category term="Core Animation"/><category term="Gdb"/><category term="GenPHP"/><category term="Gentoo"/><category term="Github"/><category term="HHVM"/><category term="Hack"/><category term="Hash Table"/><category term="History"/><category term="Homebrew"/><category term="I18N"/><category term="IE"/><category term="Judy Array"/><category term="KDE"/><category term="LLVM"/><category term="Laptop"/><category term="Lftp"/><category term="Live"/><category term="Log"/><category term="Macports"/><category term="Microsoft Keyboard"/><category term="Mobile"/><category term="Moose"/><category term="ODBC"/><category term="Obj-C"/><category term="Objective-C"/><category term="PHP Extension"/><category term="Pango"/><category term="Phar"/><category term="Polymorphism"/><category term="Pyrus"/><category term="Python"/><category term="R3"/><category term="Ruby"/><category term="SD"/><category term="SSD"/><category term="Subversion"/><category term="Symfony"/><category term="Table"/><category term="Twitter"/><category term="VM"/><category term="WIFLY"/><category term="Windows"/><category term="X Window"/><category term="Yi"/><category term="Zend"/><category term="asmjit"/><category term="assembly"/><category term="asset"/><category term="command-line"/><category term="coscup"/><category term="dfa"/><category term="iOS"/><category term="iPhone"/><category term="irc"/><category term="keychain"/><category term="libjit"/><category term="phpbrew"/><category term="prefix tree"/><category term="social coding"/><category term="ssh"/><category term="trie"/><category term="xdebug"/><category term="介面"/><category term="多型"/><category term="張榮發"/><category term="老皮帶隊亂亂翻"/><category term="費率"/><title type='text'>c9s</title><subtitle type='html'>林佑安的技術博客 Yo-An Lin。  english posts on &lt;a href=&quot;http://c9sen.blogspot.com&quot;&gt;http://c9sen.blogspot.tw/&lt;/a&gt;</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://c9s.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3147036244016021082/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://c9s.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/3147036244016021082/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/05514217676033260267</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>393</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-3147036244016021082.post-5428103760282568926</id><published>2015-05-01T11:51:00.004+08:00</published><updated>2015-05-01T18:41:11.259+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CSS"/><category scheme="http://www.blogger.com/atom/ns#" term="SASS"/><title type='text'>一些 SASS 的詭異編譯行為</title><content type='html'>最近在研究 SASS 的 Syntax 跟 Behaviour 發現相當多詭異的地方，根據&lt;a href=&quot;http://webdesign.tutsplus.com/tutorials/all-you-ever-need-to-know-about-sass-interpolation--cms-21375&quot;&gt;這篇文章 All You Ever Need to Know About Sass Interpolation&lt;/a&gt;&amp;nbsp;探討 SASS 的 Interpolation:&lt;br /&gt;
&lt;br /&gt;
其中像是:&lt;br /&gt;
&lt;br /&gt;
width: calc(10px + 10px);&lt;br /&gt;
&lt;br /&gt;
會被當成 string 編譯成:&lt;br /&gt;
&lt;br /&gt;
width: calc(10px + 10px);&lt;br /&gt;
&lt;br /&gt;
所以為了安插 Expression，就要寫成:&lt;br /&gt;
&lt;br /&gt;
width: calc(#{ 10px + 10px });&lt;br /&gt;
&lt;br /&gt;
而:&lt;br /&gt;
&lt;br /&gt;
$some: 20px;&lt;br /&gt;
&lt;div&gt;
&lt;div&gt;
width: calc(100% - $some);&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
會變成&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
width: calc(100% - $some);&lt;/div&gt;
&lt;br /&gt;
但:&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;-webkit-transition: all 10s + 1s cubic-bezier(.1 + .1, .10, .25, .90);&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Function 裏頭的 Expression 還是會照常編譯，變成:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
-webkit-transition: all 11s cubic-bezier(0.2, 0.1, 0.25, 0.9);&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
根據該文 linear-gradient 也是把 function params 當成 string，但是在新版 SASS 行為卻又不同了;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
background: linear-gradient( 10deg + 45deg, blue, #000000 + #010101);&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
直接編譯成:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
background: linear-gradient(55deg, blue, #010101);&lt;br /&gt;
&lt;br /&gt;
啥?&lt;br /&gt;
&lt;br /&gt;
再來看一些例子.. SASS Reference 內提到 expression 之間如果有空白或者逗號就是 List 表示，那麼我假設下面這樣是 List:&lt;br /&gt;
&lt;br /&gt;
&amp;gt;&amp;gt; abc blacc abc&lt;br /&gt;
(&quot;abc&quot; &quot;blacc&quot; &quot;abc&quot;)&lt;br /&gt;
&lt;br /&gt;
這樣是沒錯的，那再來試試看別的:&lt;br /&gt;
&lt;br /&gt;
&amp;gt;&amp;gt; abc blacc a#{test} abc&lt;br /&gt;
&quot;abc blacc atest abc&quot;&lt;br /&gt;
&lt;br /&gt;
居然變成 String 了，好吧文件上寫說可以用圓括號將 List 括起來，那這樣呢?&lt;br /&gt;
&lt;br /&gt;
&amp;gt;&amp;gt; (abc blacc a#{test} abc)&lt;br /&gt;
&quot;abc blacc atest abc&quot;&lt;br /&gt;
&lt;br /&gt;
居然還是 String .... WTF?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://c9s.blogspot.com/feeds/5428103760282568926/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://c9s.blogspot.com/2015/05/sass.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3147036244016021082/posts/default/5428103760282568926'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3147036244016021082/posts/default/5428103760282568926'/><link rel='alternate' type='text/html' href='http://c9s.blogspot.com/2015/05/sass.html' title='一些 SASS 的詭異編譯行為'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/05514217676033260267</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3147036244016021082.post-6706657715299498830</id><published>2015-04-26T23:39:00.001+08:00</published><updated>2015-04-28T11:44:22.208+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CSS"/><category scheme="http://www.blogger.com/atom/ns#" term="SASS"/><title type='text'>SASS 開發團隊</title><content type='html'>SASS 一開始是 Hampton Litorn 所設計的，但他現在已經不負責這個專案，現在 SASS 專案的主要執行者是 Natalie Weizenbaum 小姐，據 Twitter 上的 Profile 知道是位 trans coder lady，目前在 Google 工作並參與 DART 專案。好強啊! 據說也是 HAML 專案的開發者之一，她應該也是 libsass 的幕後最主要的推手。&lt;br /&gt;
&lt;br /&gt;
至於 Chris Eppstein 則是 Compass 的作者，Compass 是 SASS 的第一個 framework，而 Chris Eppstein 目前在 Linked-in 工作。</content><link rel='replies' type='application/atom+xml' href='http://c9s.blogspot.com/feeds/6706657715299498830/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://c9s.blogspot.com/2015/04/sass.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3147036244016021082/posts/default/6706657715299498830'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3147036244016021082/posts/default/6706657715299498830'/><link rel='alternate' type='text/html' href='http://c9s.blogspot.com/2015/04/sass.html' title='SASS 開發團隊'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/05514217676033260267</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3147036244016021082.post-7392853300348700606</id><published>2015-04-20T14:36:00.001+08:00</published><updated>2015-04-20T14:36:17.282+08:00</updated><title type='text'>PHP - Deprecation notice</title><content type='html'>在開發函式庫時，免不了會修正 Class API 或是做一些重新命名, 重構等動作，接著做下一個版本的釋出。&lt;br /&gt;
&lt;br /&gt;
Minor 版本的修正還好，但是 Major version 釋出時，如果你沒有先警告 User 哪些東西已經 deprecated 的話，是會遭到抱怨的。&lt;br /&gt;
&lt;br /&gt;
這邊基本上有幾種做法:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;針對 Critical Deprecation 的，可以 throw 出一個客製的 DeprecationException extends from LogicException&lt;/li&gt;
&lt;li&gt;另外一種做法是比較 soft failure 的，使用 trigger_error，但把 message type 設定成 E_USER_DEPRECATED&lt;/li&gt;
&lt;/ol&gt;
&lt;br /&gt;
以下是使用 trigger_error 的 snippet:&lt;br /&gt;
&lt;br /&gt;
&lt;code&gt;&lt;/code&gt;&lt;br /&gt;
trigger_error(&quot;Deprecated class, please use MetadataRevisionSchema instead.&quot;, E_USER_DEPRECATED);&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://c9s.blogspot.com/feeds/7392853300348700606/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://c9s.blogspot.com/2015/04/php-deprecation-notice.html#comment-form' title='70 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3147036244016021082/posts/default/7392853300348700606'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3147036244016021082/posts/default/7392853300348700606'/><link rel='alternate' type='text/html' href='http://c9s.blogspot.com/2015/04/php-deprecation-notice.html' title='PHP - Deprecation notice'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/05514217676033260267</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>70</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3147036244016021082.post-5743272191904994924</id><published>2015-03-31T22:23:00.000+08:00</published><updated>2015-03-31T22:25:18.871+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="iOS"/><title type='text'> iOS 8 地雷地圖</title><content type='html'>最近為了做 PM2.5 監測用 App - &lt;a href=&quot;https://itunes.apple.com/tw/app/fei-yu-qing/id975992396?mt=8&quot;&gt;肺欲清&lt;/a&gt;，著手開始了 iOS 的開發，這兩個禮拜來大致上瞭解了 iOS development 如何不踩到地雷的大邏輯。&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://3.bp.blogspot.com/-jLg3SPWa_1g/VRquJ7QkxZI/AAAAAAAALwM/huOFsrcKnnc/s1600/iOS%2BSimulator%2BScreen%2BShot%2BMar%2B31%2C%2B2015%2C%2B11.05.50.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;http://3.bp.blogspot.com/-jLg3SPWa_1g/VRquJ7QkxZI/AAAAAAAALwM/huOFsrcKnnc/s1600/iOS%2BSimulator%2BScreen%2BShot%2BMar%2B31%2C%2B2015%2C%2B11.05.50.png&quot; height=&quot;320&quot; width=&quot;179&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
只要是 Apple 預先幫你用現有元件另外組好的元件都不要用，譬如說:&lt;br /&gt;
&lt;br /&gt;
1. iOS 7 的時候提供了 UISearchDisplayController &amp;amp; Search Bar ，他基本上就是 Search Bar 加上一組隱藏好的 Search Display Controller 幫你處理一些隱藏邏輯，在 iOS 8 的時候 UISearchDisplayController 就被 deprecate 掉了， Apple 建議改用 UISearchController，該元件幫你處理好了 UISearchBar 跟 Search Logic 的部分。但其中自動產生的 SearchBar 如果用了 Scope，Layout 會整個爛掉... 所以這種情況下，倒不如自己手動用 UISearchBar 跟客製化的 Search Controller 會比 UISearchController 或 UISearchDisplayController 來得穩且透明。&lt;br /&gt;
&lt;br /&gt;
2. UITableViewController 就是內建 UITableView 的 Controller，在 ExtendedEdge 會有 Bug .. TableView 會被畫在 StatusBar 底下...&lt;br /&gt;
&lt;br /&gt;
另外建議新的東西如果沒有特別需要，盡量都不要用，舊的被 Deprecated 的反而可以盡量多留久一點，原因是: 舊的會比新的被建議的方式穩定 XD 俗話說 If it&#39;s not broken, don&#39;t fix it.&lt;br /&gt;
&lt;br /&gt;
#iOSMineMap</content><link rel='replies' type='application/atom+xml' href='http://c9s.blogspot.com/feeds/5743272191904994924/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://c9s.blogspot.com/2015/03/ios-8.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3147036244016021082/posts/default/5743272191904994924'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3147036244016021082/posts/default/5743272191904994924'/><link rel='alternate' type='text/html' href='http://c9s.blogspot.com/2015/03/ios-8.html' title=' iOS 8 地雷地圖'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/05514217676033260267</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/-jLg3SPWa_1g/VRquJ7QkxZI/AAAAAAAALwM/huOFsrcKnnc/s72-c/iOS%2BSimulator%2BScreen%2BShot%2BMar%2B31%2C%2B2015%2C%2B11.05.50.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3147036244016021082.post-6899506804458471885</id><published>2015-03-02T16:10:00.001+08:00</published><updated>2015-03-02T16:11:20.220+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Compiler"/><category scheme="http://www.blogger.com/atom/ns#" term="v8"/><category scheme="http://www.blogger.com/atom/ns#" term="VM"/><title type='text'>Lars Bak 談 JavaScript V8 virtual machine 的設計</title><content type='html'>&lt;div style=&quot;background-color: white; color: #141823; font-family: Helvetica, Arial, &#39;lucida grande&#39;, tahoma, verdana, arial, sans-serif; font-size: 15px; line-height: 20.7000007629395px; margin-bottom: 6px;&quot;&gt;
Lars Bak 談 JavaScript V8 virtual machine 的設計:&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #141823; font-family: Helvetica, Arial, &#39;lucida grande&#39;, tahoma, verdana, arial, sans-serif; font-size: 15px; line-height: 20.7000007629395px; margin-bottom: 6px; margin-top: 6px;&quot;&gt;
其中 Lars 有談到 V8 不使用 byte code，你能夠執行 JavaScript 唯一的方式就是透過 native code，所有的程式都是先編譯後執行，沒有解譯:&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #141823; font-family: Helvetica, Arial, &#39;lucida grande&#39;, tahoma, verdana, arial, sans-serif; font-size: 15px; line-height: 20.7000007629395px; margin-bottom: 6px; margin-top: 6px;&quot;&gt;
&quot;There is no interpretation and no bytecode.&quot;&lt;/div&gt;
&lt;div class=&quot;text_exposed_show&quot; style=&quot;background-color: white; color: #141823; display: inline; font-family: Helvetica, Arial, &#39;lucida grande&#39;, tahoma, verdana, arial, sans-serif; font-size: 15px; line-height: 20.7000007629395px;&quot;&gt;
&lt;div style=&quot;margin-bottom: 6px;&quot;&gt;
V8 不像其他 VM 是透過 bytecode 或是像 JVM 有 HotSpot 有多種方式執行程式，如在 interpreter 或 native code 之間切換。Lars Bak 開玩笑的說，Developer 在改 V8 compiler 的時候，他們看到這些 native code ... will be horrified.&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 6px; margin-top: 6px;&quot;&gt;
直接在執行期間 compile 成 native code 執行的這個設計與一般 VM 大相逕庭，因為不管是 JVM, PHP, Python, Ruby, C# 都是透過 Byte code 做 interpretation，而這點引起了 Erik Meijer 不理解而提出質疑。&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 6px; margin-top: 6px;&quot;&gt;
Lars Bak 解釋道 「若我們設計了 IR (Intermediate Representation) 中介表示，我們就必須對這些 IR 做驗證 (validation)，然而驗證 IR 是非常複雜的，譬如驗證 Byte code 是否有 Violation 等等。 譬如說 JMP，你必須驗證 JMP 的位址是正確的，否則會有安全顧慮。 」&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 6px; margin-top: 6px;&quot;&gt;
而我認為這是沒錯的，一般 Interpreter 儲存 op list 於 HEAP 中，只需 RW 權限即可竄改 op list，但 V8 是在用戶端執行的，你很難保證在用戶端的環境的安全性是足夠的，我猜這是 Lars Bak 過去在 Sun microsystem 做 JVM 以來的經驗。 Lars Bak 不僅為了高效能設計 V8 而也兼顧了安全性。&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 6px; margin-top: 6px;&quot;&gt;
話說，翻了幾個 VM 的 source code，不管是 cpython, perl, cruby ，目前覺得還是 V8 的架構最優、workaround 最少、最簡潔，完全是不同等級的實作&lt;br /&gt;
&lt;br /&gt;
&lt;iframe allowfullscreen=&quot;&quot; frameborder=&quot;0&quot; height=&quot;360&quot; src=&quot;//channel9.msdn.com/Shows/Going+Deep/Expert-to-Expert-Erik-Meijer-and-Lars-Bak-Inside-V8-A-Javascript-Virtual-Machine/player&quot; width=&quot;640&quot;&gt;&lt;/iframe&gt;

&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 6px; margin-top: 6px;&quot;&gt;
&lt;a href=&quot;http://channel9.msdn.com/Shows/Going+Deep/Expert-to-Expert-Erik-Meijer-and-Lars-Bak-Inside-V8-A-Javascript-Virtual-Machine&quot; style=&quot;color: #3b5998; cursor: pointer; text-decoration: none;&quot; target=&quot;_blank&quot;&gt;http://channel9.msdn.com/…/Expert-to-Expert-Erik-Meijer-and…&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 6px; margin-top: 6px;&quot;&gt;
同步刊載於&amp;nbsp;&lt;a class=&quot;profileLink&quot; data-gt=&quot;{&amp;quot;entity&amp;quot;:&amp;quot;1548717678699140&amp;quot;,&amp;quot;path&amp;quot;:&amp;quot;\/profile_book.php&amp;quot;}&quot; data-hovercard=&quot;/ajax/hovercard/page.php?id=1548717678699140&quot; href=&quot;https://www.facebook.com/pages/C9S-%E9%96%8B%E6%BA%90%E9%9B%BB%E5%8F%B0/1548717678699140&quot; style=&quot;color: #3b5998; cursor: pointer; text-decoration: none;&quot;&gt;C9S 開源電台&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://c9s.blogspot.com/feeds/6899506804458471885/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://c9s.blogspot.com/2015/03/lars-bak-javascript-v8-virtual-machine.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3147036244016021082/posts/default/6899506804458471885'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3147036244016021082/posts/default/6899506804458471885'/><link rel='alternate' type='text/html' href='http://c9s.blogspot.com/2015/03/lars-bak-javascript-v8-virtual-machine.html' title='Lars Bak 談 JavaScript V8 virtual machine 的設計'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/05514217676033260267</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3147036244016021082.post-5215332779232662542</id><published>2015-02-27T21:19:00.000+08:00</published><updated>2015-02-27T21:19:08.872+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="asmjit"/><category scheme="http://www.blogger.com/atom/ns#" term="jit"/><category scheme="http://www.blogger.com/atom/ns#" term="libjit"/><title type='text'>asmjit 與 libjit</title><content type='html'>&lt;div style=&quot;background-color: white; color: #141823; font-family: Helvetica, Arial, &#39;lucida grande&#39;, tahoma, verdana, arial, sans-serif; font-size: 15px; line-height: 20.7000007629395px; margin-bottom: 6px;&quot;&gt;
大略翻了 asmjit [1] 與 libjit [2] 的實作，大概簡介一下兩者差異:&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #141823; font-family: Helvetica, Arial, &#39;lucida grande&#39;, tahoma, verdana, arial, sans-serif; font-size: 15px; line-height: 20.7000007629395px; margin-bottom: 6px; margin-top: 6px;&quot;&gt;
asmjit 是針對 x86 平台所做的 just-in-time toolkit，可以在 runtime 進行組語編譯並執行，分成兩種 compilation method:&lt;br /&gt;.&lt;br /&gt;1. Assembler: 直接使用 x86 instruction 撰寫編譯，必須寫清楚 register, memory 等 operand。&lt;span class=&quot;text_exposed_show&quot; style=&quot;display: inline;&quot;&gt;&lt;br /&gt;2. Compiler: 使用抽象化語法進行編譯，不需自己管理暫存器。&lt;br /&gt;.&lt;br /&gt;其中抽象化語法可直接使用 Variable 並且由 Compiler 自行分配暫存器，超出的部分會自動使用 Stack 的空間。&lt;br /&gt;&lt;br /&gt;而其語法其實就是 C++，通過調用 FunctionBuilder 來建置 Function ，最後丟給 Compiler 編譯後即可使用，但 Register Allocation 的部分分析能力不強，因此作者建議若有自己做 Analysis 的話，建議還是直接使用 Assembler。 由於是 C++ 實作，asmjit 語法簡潔有力。對 x86 機器的實作算很完整。&lt;br /&gt;&lt;br /&gt;而 libjit 較為複雜些，libjit 使用 C 語言實作，編譯單元為 Function，用法類似 asmjit 定義 Function 的方式，但定義起來較為繁瑣。 除了抽象化 opcode 來達到跨平台的目的 (目前支援 arm, x86, x86-64)，還實作了 data flow analysis, control flow analysis 來做優化，優化的部分則可以指定等級。&lt;br /&gt;&lt;br /&gt;其中 CodeGen 的部分，居然自己定義了一套 DSL 的 parser 來產生類似 LLVM Instruction Table 的定義檔... 完全不容小覷。 據我與 Marttia Barbon 通信內容了解，libjit 產生的 machine code 並不太優。&lt;br /&gt;&lt;br /&gt;libjit 中 x86 instruction assembler 的部分，是直接使用 C function 來達成 position independent instruction 的編譯:&lt;br /&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; x86_mov_reg_reg(buf, X86_EBP, X86_ESP, 4);&lt;br /&gt;&lt;br /&gt;要使用 libjit 來建置一套 language VM 應該是足夠的，只不過 libjit 最近較無積極開發，最近一年的 commit 幾乎都是修正。&lt;/span&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://c9s.blogspot.com/feeds/5215332779232662542/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://c9s.blogspot.com/2015/02/asmjit-libjit.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3147036244016021082/posts/default/5215332779232662542'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3147036244016021082/posts/default/5215332779232662542'/><link rel='alternate' type='text/html' href='http://c9s.blogspot.com/2015/02/asmjit-libjit.html' title='asmjit 與 libjit'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/05514217676033260267</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3147036244016021082.post-5560877718093158207</id><published>2015-02-25T19:22:00.002+08:00</published><updated>2015-02-25T19:22:25.271+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CLI"/><category scheme="http://www.blogger.com/atom/ns#" term="Php"/><category scheme="http://www.blogger.com/atom/ns#" term="Table"/><title type='text'>CLIFramework - Table Generator</title><content type='html'>&lt;span class=&quot;text_exposed_show&quot; style=&quot;display: inline;&quot;&gt;&lt;a href=&quot;https://github.com/c9s/CLIFramework&quot;&gt;CLIFramework&lt;/a&gt; 現在內建 Table Generator，只要輸入 Array，可自動依照不同的 Style 產生 Console 用表格，甚至能輸出成 Markdown 格式表格 (使用 MarkdownStyleTable class)&lt;br /&gt;&lt;br /&gt;此套件是參考 &lt;a href=&quot;http://symfony.com/doc/current/components/console/introduction.html&quot;&gt;Symfony/Console&lt;/a&gt; 的 Table Helper 部分功能的重寫及加強，除了 Symfony/Console 現有功能之外: &lt;br /&gt;&lt;br /&gt;還可透過指定格屬性 (Cell Attribute)，針對單一格或一整列設定色彩、文字對齊或數字格式 (Currency, Number, Duration .. etc)&lt;br /&gt;&lt;br /&gt;至於超出欄寬的文字，也可指定使用切斷 (clip), 省略符號 (ellipsis) 或換行 (wrap)&lt;br /&gt;&lt;br /&gt;請見範例程式:&lt;br /&gt;&lt;a href=&quot;https://github.com/c9s/CLIFramework/blob/master/example/table.php&quot; rel=&quot;nofollow nofollow&quot; style=&quot;background-color: white; color: #3b5998; cursor: pointer; font-family: Helvetica, Arial, &#39;lucida grande&#39;, tahoma, verdana, arial, sans-serif; font-size: 15px; line-height: 20px; text-decoration: none;&quot; target=&quot;_blank&quot;&gt;https://github.com/c9s/CLIFramework/blob/master/example/table.php&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
畫面:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://3.bp.blogspot.com/-H18QCm_w0Io/VO2wJZ3gGEI/AAAAAAAALvI/BEC_Lr-mLSk/s1600/Screenshot%2B2015-02-25%2B18.52.59.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;http://3.bp.blogspot.com/-H18QCm_w0Io/VO2wJZ3gGEI/AAAAAAAALvI/BEC_Lr-mLSk/s1600/Screenshot%2B2015-02-25%2B18.52.59.png&quot; height=&quot;264&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://c9s.blogspot.com/feeds/5560877718093158207/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://c9s.blogspot.com/2015/02/cliframework-table-generator.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3147036244016021082/posts/default/5560877718093158207'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3147036244016021082/posts/default/5560877718093158207'/><link rel='alternate' type='text/html' href='http://c9s.blogspot.com/2015/02/cliframework-table-generator.html' title='CLIFramework - Table Generator'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/05514217676033260267</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/-H18QCm_w0Io/VO2wJZ3gGEI/AAAAAAAALvI/BEC_Lr-mLSk/s72-c/Screenshot%2B2015-02-25%2B18.52.59.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3147036244016021082.post-6560802413089504357</id><published>2015-02-10T13:19:00.005+08:00</published><updated>2015-02-10T13:24:44.047+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="assembly"/><category scheme="http://www.blogger.com/atom/ns#" term="jit"/><category scheme="http://www.blogger.com/atom/ns#" term="v8"/><title type='text'></title><content type='html'>&lt;div style=&quot;background-color: white; color: #141823; font-family: Helvetica, Arial, &#39;lucida grande&#39;, tahoma, verdana, arial, sans-serif; font-size: 15px; line-height: 20.7000007629395px; margin-bottom: 6px;&quot;&gt;
&lt;span style=&quot;line-height: 20.7000007629395px;&quot;&gt;閒暇時大致研究了幾個 JIT compiler 實作:&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #141823; font-family: Helvetica, Arial, &#39;lucida grande&#39;, tahoma, verdana, arial, sans-serif; font-size: 15px; line-height: 20.7000007629395px; margin-bottom: 6px;&quot;&gt;
&lt;span style=&quot;line-height: 20.7000007629395px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #141823; font-family: Helvetica, Arial, &#39;lucida grande&#39;, tahoma, verdana, arial, sans-serif; font-size: 15px; line-height: 20.7000007629395px; margin-bottom: 6px; margin-top: 6px;&quot;&gt;
V8 當然不用說，不僅實作了好幾種 CPU 架構的 runtime assembler ，還做了 dynamic re-compilation (&lt;a href=&quot;http://blog.chromium.org/2010/12/new-crankshaft-for-v8.html&quot;&gt;Crankshaft&lt;/a&gt; engine) 針對 hot code 做 re-compilation。&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #141823; font-family: Helvetica, Arial, &#39;lucida grande&#39;, tahoma, verdana, arial, sans-serif; font-size: 15px; line-height: 20.7000007629395px; margin-bottom: 6px; margin-top: 6px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #141823; font-family: Helvetica, Arial, &#39;lucida grande&#39;, tahoma, verdana, arial, sans-serif; font-size: 15px; line-height: 20.7000007629395px; margin-bottom: 6px; margin-top: 6px;&quot;&gt;
而 Steffen Müller (&lt;a href=&quot;https://github.com/tsee&quot;&gt;@tsee&lt;/a&gt;)&amp;nbsp;的 &lt;a href=&quot;https://github.com/tsee/jit-experiments&quot;&gt;jit-experimental&lt;/a&gt; for Perl 則是將 Perl5 op tree 建構成 libjit 看得懂得 AST，接著丟改 libjit 翻譯回來拿到 machine code，細節沒有看很多，但我猜這個 runtime overhead 一定是很高...&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #141823; font-family: Helvetica, Arial, &#39;lucida grande&#39;, tahoma, verdana, arial, sans-serif; font-size: 15px; line-height: 20.7000007629395px; margin-bottom: 6px; margin-top: 6px;&quot;&gt;
其他使用的 &lt;a href=&quot;https://www.gnu.org/software/libjit/&quot;&gt;libjit&lt;/a&gt; 的 project 則幾乎都是 experimental projects，沒有看到其他使用 libjit 成功的案例。&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; margin-bottom: 6px; margin-top: 6px;&quot;&gt;
&lt;span style=&quot;color: #141823; font-family: Helvetica, Arial, lucida grande, tahoma, verdana, arial, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 15px; line-height: 20.7000007629395px;&quot;&gt;Reini Urban (&lt;/span&gt;&lt;/span&gt;&lt;a href=&quot;https://github.com/rurban&quot; style=&quot;font-family: Helvetica, Arial, &#39;lucida grande&#39;, tahoma, verdana, arial, sans-serif; font-size: 15px; line-height: 20.7000007629395px;&quot;&gt;@rurban&lt;/a&gt;)&amp;nbsp;&lt;span style=&quot;color: #141823; font-family: Helvetica, Arial, &#39;lucida grande&#39;, tahoma, verdana, arial, sans-serif; font-size: 15px; line-height: 20.7000007629395px;&quot;&gt;的 &lt;/span&gt;&lt;a href=&quot;https://github.com/rurban/Jit&quot; style=&quot;font-family: Helvetica, Arial, &#39;lucida grande&#39;, tahoma, verdana, arial, sans-serif; font-size: 15px; line-height: 20.7000007629395px;&quot;&gt;Jit.pm&lt;/a&gt;&lt;span style=&quot;color: #141823; font-family: Helvetica, Arial, &#39;lucida grande&#39;, tahoma, verdana, arial, sans-serif; font-size: 15px; line-height: 20.7000007629395px;&quot;&gt; 實作，是把固定幾個 x86 instruction 的 machine code 直接寫成 macro 來使用 (如: x86 prolog, epilog, call, jmp, pushl, popl 等等)，然後在模組載入後，把 Perl 的 run op 函數指標 (function pointer) 換成 Jit.pm 自己的實作，接下來就是把一些簡單的 op code 換成預先準備好的 machine code 執行。 但 Jit.pm 一執行就 crash 了..... orz&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #141823; font-family: Helvetica, Arial, &#39;lucida grande&#39;, tahoma, verdana, arial, sans-serif; font-size: 15px; line-height: 20.7000007629395px; margin-bottom: 6px; margin-top: 6px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #141823; font-family: Helvetica, Arial, &#39;lucida grande&#39;, tahoma, verdana, arial, sans-serif; font-size: 15px; line-height: 20.7000007629395px; margin-bottom: 6px; margin-top: 6px;&quot;&gt;
不過 Jit.pm 也教我幾件事情:&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #141823; font-family: Helvetica, Arial, &#39;lucida grande&#39;, tahoma, verdana, arial, sans-serif; font-size: 15px; line-height: 20.7000007629395px; margin-bottom: 6px; margin-top: 6px;&quot;&gt;
1. memalign 要處理好，不然沒有辦法設置 memory protection&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #141823; font-family: Helvetica, Arial, &#39;lucida grande&#39;, tahoma, verdana, arial, sans-serif; font-size: 15px; line-height: 20.7000007629395px; margin-bottom: 6px; margin-top: 6px;&quot;&gt;
2. self-modifying code 需要呼叫 &lt;a href=&quot;http://man7.org/linux/man-pages/man2/mprotect.2.html&quot;&gt;sys_mprotect&lt;/a&gt; 這個修改 page 的 flags ，才能在調用來的記憶體上執行 machine code。&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #141823; font-family: Helvetica, Arial, &#39;lucida grande&#39;, tahoma, verdana, arial, sans-serif; font-size: 15px; line-height: 20.7000007629395px; margin-bottom: 6px; margin-top: 6px;&quot;&gt;
3. Perl 5 有 ASYNC flag (看起來是做 JIT 特別難處理的地方)&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #141823; font-family: Helvetica, Arial, &#39;lucida grande&#39;, tahoma, verdana, arial, sans-serif; font-size: 15px; line-height: 20.7000007629395px; margin-bottom: 6px; margin-top: 6px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #141823; font-family: Helvetica, Arial, &#39;lucida grande&#39;, tahoma, verdana, arial, sans-serif; font-size: 15px; line-height: 20.7000007629395px; margin-bottom: 6px; margin-top: 6px;&quot;&gt;
&lt;span style=&quot;line-height: 20.7000007629395px;&quot;&gt;現階段看起來，JIT 實作的最佳參考還是 V8&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #141823; display: inline; font-family: Helvetica, Arial, &#39;lucida grande&#39;, tahoma, verdana, arial, sans-serif; font-size: 15px; line-height: 20.7000007629395px; margin-top: 6px;&quot;&gt;
就這樣，有其他細節再繼續做整理...&lt;/div&gt;
&lt;div&gt;
&lt;div style=&quot;background-color: white; color: #141823; display: inline; font-family: Helvetica, Arial, &#39;lucida grande&#39;, tahoma, verdana, arial, sans-serif; font-size: 15px; line-height: 20.7000007629395px; margin-top: 6px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;div style=&quot;background-color: white; color: #141823; display: inline; font-family: Helvetica, Arial, &#39;lucida grande&#39;, tahoma, verdana, arial, sans-serif; font-size: 15px; line-height: 20.7000007629395px; margin-top: 6px;&quot;&gt;
&lt;span style=&quot;line-height: 20.7000007629395px;&quot;&gt;(以前實在太弱，寫什麼 SIC/XE assembler... 現在覺得當時應該接著練習自幹 x86 assembler 比較實際...)&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://c9s.blogspot.com/feeds/6560802413089504357/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://c9s.blogspot.com/2015/02/jit-compiler-v8-cpu-runtime-assembler.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3147036244016021082/posts/default/6560802413089504357'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3147036244016021082/posts/default/6560802413089504357'/><link rel='alternate' type='text/html' href='http://c9s.blogspot.com/2015/02/jit-compiler-v8-cpu-runtime-assembler.html' title=''/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/05514217676033260267</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3147036244016021082.post-6769963612349378664</id><published>2015-02-08T15:49:00.002+08:00</published><updated>2015-02-08T15:49:51.211+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="social coding"/><title type='text'>Getting Merged</title><content type='html'>&lt;div style=&quot;background-color: white; color: #141823; font-family: Helvetica, Arial, &#39;lucida grande&#39;, tahoma, verdana, arial, sans-serif; font-size: 15px; line-height: 20.7000007629395px; margin-bottom: 6px;&quot;&gt;
昨天在 livehouse 的簡報。但有些內容是現場講的，沒報名到的朋友搜瑞了&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #141823; font-family: Helvetica, Arial, &#39;lucida grande&#39;, tahoma, verdana, arial, sans-serif; font-size: 15px; line-height: 20.7000007629395px; margin-bottom: 6px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #141823; font-family: Helvetica, Arial, &#39;lucida grande&#39;, tahoma, verdana, arial, sans-serif; font-size: 15px; line-height: 20.7000007629395px; margin-bottom: 6px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;

&lt;iframe src=&quot;//www.slideshare.net/slideshow/embed_code/44267614&quot; width=&quot;425&quot; height=&quot;355&quot; frameborder=&quot;0&quot; marginwidth=&quot;0&quot; marginheight=&quot;0&quot; scrolling=&quot;no&quot; style=&quot;border:1px solid #CCC; border-width:1px; margin-bottom:5px; max-width: 100%;&quot; allowfullscreen&gt; &lt;/iframe&gt; &lt;div style=&quot;margin-bottom:5px&quot;&gt; &lt;strong&gt; &lt;a href=&quot;//www.slideshare.net/c9s/getting-merged&quot; title=&quot;Getting merged&quot; target=&quot;_blank&quot;&gt;Getting merged&lt;/a&gt; &lt;/strong&gt; from &lt;strong&gt;&lt;a href=&quot;//www.slideshare.net/c9s&quot; target=&quot;_blank&quot;&gt;Yo-An Lin&lt;/a&gt;&lt;/strong&gt; &lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://c9s.blogspot.com/feeds/6769963612349378664/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://c9s.blogspot.com/2015/02/getting-merged.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3147036244016021082/posts/default/6769963612349378664'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3147036244016021082/posts/default/6769963612349378664'/><link rel='alternate' type='text/html' href='http://c9s.blogspot.com/2015/02/getting-merged.html' title='Getting Merged'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/05514217676033260267</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3147036244016021082.post-4445034599442616996</id><published>2015-02-08T15:47:00.001+08:00</published><updated>2015-02-08T15:47:34.757+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="jit"/><title type='text'></title><content type='html'>&lt;div style=&quot;background-color: white; color: #141823; font-family: Helvetica, Arial, &#39;lucida grande&#39;, tahoma, verdana, arial, sans-serif; font-size: 15px; line-height: 20.7000007629395px; margin-bottom: 6px;&quot;&gt;
libjit 的作者 Rhys Weatherley (dotGNU 的 member) 2009 年時寫到:&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #141823; font-family: Helvetica, Arial, &#39;lucida grande&#39;, tahoma, verdana, arial, sans-serif; font-size: 15px; line-height: 20.7000007629395px; margin-bottom: 6px; margin-top: 6px;&quot;&gt;
&quot;LLVM seems to have been started as a &quot;glorified&quot; static compiler....which aims to (略).... It has been started in 2000, and as of today it is technologically outdated. &quot;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #141823; display: inline; font-family: Helvetica, Arial, &#39;lucida grande&#39;, tahoma, verdana, arial, sans-serif; font-size: 15px; line-height: 20.7000007629395px; margin-top: 6px;&quot;&gt;
哇....這不是睜眼說瞎話嗎? XD&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://c9s.blogspot.com/feeds/4445034599442616996/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://c9s.blogspot.com/2015/02/libjit-rhys-weatherley-dotgnu-member.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3147036244016021082/posts/default/4445034599442616996'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3147036244016021082/posts/default/4445034599442616996'/><link rel='alternate' type='text/html' href='http://c9s.blogspot.com/2015/02/libjit-rhys-weatherley-dotgnu-member.html' title=''/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/05514217676033260267</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3147036244016021082.post-7984900062916345669</id><published>2014-09-25T22:09:00.004+08:00</published><updated>2014-09-25T22:20:09.234+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Hack"/><category scheme="http://www.blogger.com/atom/ns#" term="HHVM"/><category scheme="http://www.blogger.com/atom/ns#" term="Php"/><title type='text'>HHVM 及 Hack 的相容性</title><content type='html'>最近筆者開始嘗試 &lt;a href=&quot;https://github.com/facebook/hhvm&quot;&gt;HHVM&lt;/a&gt; 應用於 Production 環境，一些心得如下:&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
1. Linux&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
現有的 Linux Distribution 幾乎都有 pre-built 套件，可直接安裝，就算要自行編譯也沒有太大的問題。 Facebook 的 HHVM Team 主要都還是 Focus 在 Linux Server 上的相容性。在 Linux 平台上編譯，可參考&lt;a href=&quot;https://github.com/facebook/hhvm/wiki/Building-and-Installing-HHVM&quot;&gt;官方的 WIKI 文件&lt;/a&gt;。&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
2. Mac OS X&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Mac OS X 上 HHVM 的相容性比以往提昇許多，過去要自行 patch 許多套件編譯，現在只需要 patch jemalloc 即可。且幾乎所有相依套件皆可用 Homebrew 或 Macports 安裝。&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
目前 HHVM 的版本 HHVM 3.2 確定可於 Mac OS X 上編譯，只不過需透過 GCC 4.8 而非 Mac OS X 內建的 clang，相依的 Boost 套件也需由 GCC 4.8 編譯才行。&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
至於 master branch 目前 third-party 的 folly package 由於使用了 Linux 上的 Futex，因此目前唯一可在 Mac OS X 上編譯的版本就只剩 3.2。 不過也有人開始了 Mac OS X 平台上的編譯修正，可參見&amp;nbsp;&lt;a href=&quot;https://github.com/mcuelenaere&quot;&gt;@mcuelenaere&lt;/a&gt; 的 HHVM&amp;nbsp;&lt;a href=&quot;https://github.com/mcuelenaere/hhvm/tree/osx-fixes&quot;&gt;osx-fixes&lt;/a&gt; 分支，以及&amp;nbsp;&lt;a href=&quot;https://github.com/bsampath&quot;&gt;@bsampath&lt;/a&gt; 的 &lt;a href=&quot;https://github.com/bsampath/folly&quot;&gt;folly 修正&lt;/a&gt;。&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
至於 3.2 版本 Mac OS X 上的編譯步驟，可參考&lt;a href=&quot;https://github.com/facebook/hhvm/wiki/Building%20and%20installing%20HHVM%20on%20OSX%2010.9&quot;&gt;此處&lt;/a&gt;。&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
3. Hack Programming Language&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
至於 Facebook 的 &lt;a href=&quot;http://hacklang.org/&quot;&gt;Hack&lt;/a&gt; programming language 幾乎與 PHP 相容，原本的 PHP source code 只需要修改標頭，將 &amp;lt;?php 改為 &amp;lt;?hh 即可當做 &lt;a href=&quot;http://hacklang.org/&quot;&gt;Hack&lt;/a&gt; 執行，因此由 PHP 換用到 &lt;a href=&quot;http://hacklang.org/&quot;&gt;Hack&lt;/a&gt; 幾乎是無痛轉移。&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
至於使用 Hack 有何好處？一來是提供型別檢查，方便開發時及早發現問題，二來依照型別資訊可大幅提昇 VM 效能，三來可以提供準確的自動補齊並與編輯器或 IDE 做整合。&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Hack 的剖析工具是用 OCaml 寫的，可直接和 IDE 整合，如 Vim plugin 有 &lt;a href=&quot;https://github.com/hhvm/vim-hack&quot;&gt;vim-hack&lt;/a&gt; (&lt;a href=&quot;https://github.com/hhvm/vim-hack&quot;&gt;https://github.com/hhvm/vim-hack&lt;/a&gt;) 可使用。Emacs 則有 hack mode 可用 (&lt;a href=&quot;https://github.com/facebook/hhvm/tree/master/hphp/hack/editor-plugins/emacs&quot;&gt;https://github.com/facebook/hhvm/tree/master/hphp/hack/editor-plugins/emacs&lt;/a&gt;)。&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
待續&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://c9s.blogspot.com/feeds/7984900062916345669/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://c9s.blogspot.com/2014/09/hhvm.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3147036244016021082/posts/default/7984900062916345669'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3147036244016021082/posts/default/7984900062916345669'/><link rel='alternate' type='text/html' href='http://c9s.blogspot.com/2014/09/hhvm.html' title='HHVM 及 Hack 的相容性'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/05514217676033260267</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3147036244016021082.post-2224966904085948133</id><published>2014-08-27T14:17:00.002+08:00</published><updated>2014-08-27T14:23:26.293+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Git"/><title type='text'>談 Git 的 Graft Points 及 git-replace</title><content type='html'>git merge --squash [branch] 可以將分支的修改全數合併至同一個 commit 但不會保留合併資訊，不過若是該分支持續開發，勢必會再次合併至主幹，這時如果重新使用 git merge --squash ，則已經合併過的 commit 也會因為重新被合併而造成衝突。&lt;br /&gt;
&lt;br /&gt;
這時，要讓 squashed commit 同時也有 merged commit 的性質，可以利用 .git/info/grafts 這個檔案或利用 git-replace 來手動定義合併資訊製作造假的合併資訊!&lt;br /&gt;
&lt;br /&gt;
好用的地方在哪個? 假設你有兩個 perforce branch，分支之間不斷大量修改合併，但使用 git-p4 clone 後，你希望這兩個 branch 的合併基底 (merge base) 重新計算，減少合併衝突，就可以利用這個 graft point 來定義合併節點。&lt;br /&gt;
&lt;br /&gt;
甚至是 git-svn 在處理樹狀目錄的合併資訊，也可以利用 graft points 來定義合併節點減少合併衝突。&lt;br /&gt;
&lt;br /&gt;
當儲存倉越來越大時，你也可以將某個 commit 之前的 history 全數壓縮到另外一個儲存倉並把古老的 commit history 全數壓起來 (squash) 來節省空間...要查看細節時，再用 git-replace 將 commit history 接回來即可。&lt;br /&gt;
&lt;br /&gt;
但 .git/info/grafts 只存在 local 端，並不會被 push 出去，因此若要能修改整個 commit tree 可利用 git replace --graft &lt;commit&gt; [&lt;parent&gt;…] 直接將 commit 換掉 parent。&lt;/parent&gt;&lt;/commit&gt;&lt;br /&gt;
&lt;br /&gt;
參見:&lt;br /&gt;
&lt;br /&gt;
git-replace: &lt;a href=&quot;http://git-scm.com/docs/git-replace.html&quot;&gt;http://git-scm.com/docs/git-replace.html&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Graft Point: &lt;a href=&quot;https://git.wiki.kernel.org/index.php/GraftPoint&quot;&gt;https://git.wiki.kernel.org/index.php/GraftPoint&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
#ThePowerfulGit</content><link rel='replies' type='application/atom+xml' href='http://c9s.blogspot.com/feeds/2224966904085948133/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://c9s.blogspot.com/2014/08/git-graft-points-git-replace.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3147036244016021082/posts/default/2224966904085948133'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3147036244016021082/posts/default/2224966904085948133'/><link rel='alternate' type='text/html' href='http://c9s.blogspot.com/2014/08/git-graft-points-git-replace.html' title='談 Git 的 Graft Points 及 git-replace'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/05514217676033260267</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3147036244016021082.post-5177649334062567729</id><published>2014-07-04T15:41:00.005+08:00</published><updated>2014-07-04T15:41:53.543+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="command-line"/><category scheme="http://www.blogger.com/atom/ns#" term="Php"/><title type='text'>CLIFramework - Command-line application framework for PHP</title><content type='html'>還在苦惱用 PHP 寫 Command-line application 要支援 zsh completion 得自己寫困難的 zsh completion 嗎?&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://github.com/c9s/CLIFramework&quot;&gt;CLIFramework&lt;/a&gt; 提供一整套框架讓你用 PHP 快速架構一支 command-line application，還可自動產生 zsh completion script 讓你 Key in 無負擔 XD&lt;br /&gt;
&lt;br /&gt;
所有的 option completion, argument completion 皆可以用純 PHP 撰寫&lt;br /&gt;
&lt;br /&gt;
請看圖 XD&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://imgur.com/sU3mrDe.gif&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;http://imgur.com/sU3mrDe.gif&quot; height=&quot;252&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
專案網址: &lt;a href=&quot;https://github.com/c9s/CLIFramework&quot;&gt;https://github.com/c9s/CLIFramework&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://c9s.blogspot.com/feeds/5177649334062567729/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://c9s.blogspot.com/2014/07/cliframework-command-line-application.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3147036244016021082/posts/default/5177649334062567729'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3147036244016021082/posts/default/5177649334062567729'/><link rel='alternate' type='text/html' href='http://c9s.blogspot.com/2014/07/cliframework-command-line-application.html' title='CLIFramework - Command-line application framework for PHP'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/05514217676033260267</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3147036244016021082.post-3899943356766808924</id><published>2014-06-26T10:10:00.001+08:00</published><updated>2014-06-26T18:32:28.068+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Homebrew"/><category scheme="http://www.blogger.com/atom/ns#" term="Macports"/><title type='text'>我為何仍繼續使用 Macports 而不用 Homebrew</title><content type='html'>很多人因為 Macports 在裝一些套件時，無法避免的另外編譯另外一套 Perl 裝至系統而跳槽使用 Homebrew。但身為一個前 Perl Developer，直接使用 System Perl as a dependency 其實並不太安全。&lt;br /&gt;
&lt;br /&gt;
其一: &amp;nbsp;Mac OS 本身在升級時，會自動將 Perl 版本升級，如果你 link 至舊版的 Perl，升級之後你的 Homebrew 套件所有相依 System Perl 幾乎都要重新編譯才行。&lt;br /&gt;
&lt;br /&gt;
但用 Macports 裝，則是將套件完全獨立一個空間出來，把套件跟 System library 的接觸面減到最小，就算是升級 Mac OS ，只要不是 32 位元轉 64 位元，原本編譯的套件幾乎都可以繼續使用。&lt;br /&gt;
&lt;br /&gt;
其二: &amp;nbsp;Macports 現在提供 pre-built 好的套件安裝檔，安裝 package 幾乎不再需要重新編譯，Installer 自動下載解開就裝完了，完全不浪費 CPU。但目前 Homebrew 裝套件應該都是要重新編譯的。&lt;br /&gt;
&lt;br /&gt;
其三: &amp;nbsp;安裝或升級套件，Macports 會自動幫你掃描是不是有 Broken library，若有問題也會自動重裝 library。(目前看起來 Homebrew 沒這個功能 ?)&lt;br /&gt;
&lt;br /&gt;
其四: Homebrew 雖然 Formula 眾多，但安裝非官方的 Formula 有時容易引起套件衝突，舉例來說 PHP 編譯有各種 configure options，各家使用的 default configure options 又不一樣，安裝 extension 的時候還會彼此影響到... 有些 Formula 還必須先查看是否有 enable 某功能，不然裝了也是白裝。&lt;br /&gt;
&lt;br /&gt;
其五: Homebrew 編譯套件不像 Macports 提供客製化 variants，你用某個 Formula 裝就是固定只能裝他預先指定好的 features，要客製化只能自己複製出來改，自己複製出來改就累了，你還得自己 maintain forumla 才行。 (更新: 據說 Homebrew 後來也支援了 option，不過升級套件要自己記住當初裝的 option 才行)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://c9s.blogspot.com/feeds/3899943356766808924/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://c9s.blogspot.com/2014/06/macports-homebrew.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3147036244016021082/posts/default/3899943356766808924'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3147036244016021082/posts/default/3899943356766808924'/><link rel='alternate' type='text/html' href='http://c9s.blogspot.com/2014/06/macports-homebrew.html' title='我為何仍繼續使用 Macports 而不用 Homebrew'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/05514217676033260267</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3147036244016021082.post-2467881786604756516</id><published>2014-06-14T10:20:00.001+08:00</published><updated>2014-06-14T10:22:59.264+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="API"/><title type='text'>一些關於 API 設計的碎碎念</title><content type='html'>平常可能寫 API 寫久了沒什麼感覺，但最近對於 API 設計感想特別多...碎碎念罷了。&lt;br /&gt;
&lt;br /&gt;
1. 各種參數的 naming 如果沒有 consistent，在不同的 context 下會很容易造成混淆，譬如說同一個參數名稱在 A context 是某種 Type，B context 卻是另外一種 Type。&lt;br /&gt;
&lt;br /&gt;
這樣的命名混淆，在一整個 process flow 裡面，一旦遇到不同的呼叫使用相同名稱卻在不同 context 有不同意義的參數，就會成為杯具。&lt;br /&gt;
&lt;br /&gt;
再怎麼樣想不到適合的名字也不該用混淆的名字&lt;br /&gt;
&lt;br /&gt;
2. 命名歸類的一致性: 譬如說某某 method 是 A 相關，可以 A 作為 prefix，那就不要突然 A 突然 B 突然又 C，否則誰知道是在幹嘛（丟鍵盤）&lt;br /&gt;
&lt;br /&gt;
3. 函式命名沒有這麼難，就算不知道怎麼命名也至少用動詞加受詞 (V+OBJ) 吧，然後 OBJ 的名稱一定要一致，不要一下 memberInfo 一下 memberData 的。&lt;br /&gt;
&lt;br /&gt;
4. 此外 method name 本身的命名應該要讓人能讀出 read-only / write 等資訊，而不是一個看起來明明是 read-only 的 API 本身卻包含了 write 的行為。&lt;br /&gt;
&lt;br /&gt;
5. 參數類型、可選不可選、臨界值、長度、不同值所代表的隱含行為在文件上寫清楚也是相當重要的，否則呼叫方若誤解了參數所帶來的隱含操作，則會造成系統不穩定。&lt;br /&gt;
&lt;br /&gt;
6. 另外參數名稱也請不要用 1234567 當 suffix 呀，若是為了安全性，你好歹也用英文縮寫。&lt;br /&gt;
&lt;br /&gt;
7. 最後，至少寫個 persistent layer 的 test 吧，curl 腳本也行，不要一下噴 HTML 一下 XML 的，明明都送 Accept: text/xml 啦！</content><link rel='replies' type='application/atom+xml' href='http://c9s.blogspot.com/feeds/2467881786604756516/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://c9s.blogspot.com/2014/06/api.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3147036244016021082/posts/default/2467881786604756516'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3147036244016021082/posts/default/2467881786604756516'/><link rel='alternate' type='text/html' href='http://c9s.blogspot.com/2014/06/api.html' title='一些關於 API 設計的碎碎念'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/05514217676033260267</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3147036244016021082.post-1277911297933642968</id><published>2014-06-11T00:02:00.001+08:00</published><updated>2014-06-11T10:16:57.920+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="c"/><category scheme="http://www.blogger.com/atom/ns#" term="CPAN"/><category scheme="http://www.blogger.com/atom/ns#" term="Perl"/><category scheme="http://www.blogger.com/atom/ns#" term="R3"/><category scheme="http://www.blogger.com/atom/ns#" term="Router"/><title type='text'>Perl URL Router Benchmarks</title><content type='html'>To improve the overhead of URL routing, I developed a tiny URL routing library in C - &lt;a href=&quot;https://github.com/c9s/r3&quot;&gt;R3&lt;/a&gt;, which is designed for high performance and low memory usage.&lt;br /&gt;
&lt;br /&gt;
The implementation uses the trie data structure. Trie is an efficient information retrieval data structure, which uses a prefix tree to search inserted strings by their common prefix, thus it&#39;s pretty fast for matching routes.&lt;br /&gt;
&lt;br /&gt;
The tricky part of R3 is that we need to support regular expression patterns in our routing definition to dispatch path dynamically, thus R3 implemented a variant of Trie by mixing some concepts of DFA, not just simply inserting plain string paths into the prefix tree.&lt;br /&gt;
&lt;br /&gt;
There are several comparison types in R3: plain string, opcode or regular expression pattern. Each node have its own comparison type to dispatch the path to their own children.&lt;br /&gt;
&lt;br /&gt;
For those simple regular expression patterns, R3 compiles the regular expressions into opcodes to enhance the comparison speed and it&#39;s twice faster than using PCRE library to match the path with the patterns.&lt;br /&gt;
&lt;br /&gt;
And since there are a lot of things to do before the matching operation, the whole tree structure needs to be compiled before dispatching paths.&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://c9s.github.io/r3/bench.html&quot;&gt;Here is the continuous benchmark result of R3 itself&lt;/a&gt;, The C version R3 can dispatch over 11 million plain string paths per second.&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://3.bp.blogspot.com/-qVaWczE6JLM/U5cA0aGo7FI/AAAAAAAALc8/ITcRr4vIAEo/s1600/Screen+Shot+2014-06-10+at+20.57.30.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;http://3.bp.blogspot.com/-qVaWczE6JLM/U5cA0aGo7FI/AAAAAAAALc8/ITcRr4vIAEo/s1600/Screen+Shot+2014-06-10+at+20.57.30.png&quot; height=&quot;252&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
A talented Perl hacker -&amp;nbsp;&lt;a href=&quot;https://metacpan.org/author/CINDY&quot;&gt;Cindy Wang&lt;/a&gt;&amp;nbsp;developed a CPAN module based on R3 library - &lt;a href=&quot;https://metacpan.org/pod/Router::R3&quot;&gt;Router::R3&lt;/a&gt;, which has become the fastest routing module on CPAN.&amp;nbsp;It&#39;s so fast that you just can&#39;t deny.&lt;br /&gt;
&lt;br /&gt;
The Perl version R3 (Router::R3) can dispatch nearly 1 million paths per second while Journey (The Rails router) dispatches 9.9 thousand plain string paths per second.&lt;br /&gt;
&lt;br /&gt;
We also used the routing path generator from the rails&#39; pull request &lt;a href=&quot;https://github.com/stevegraham/rails/pull/1&quot;&gt;stevegraham/rails/pull/1&lt;/a&gt;&amp;nbsp;to benchmark the Perl URL routers on CPAN, including&amp;nbsp;&lt;a href=&quot;https://metacpan.org/pod/HTTP::Router&quot;&gt;HTTP::Router&lt;/a&gt;, &lt;a href=&quot;https://metacpan.org/pod/Router::Simple&quot;&gt;Router::Simple&lt;/a&gt;, &lt;a href=&quot;https://metacpan.org/pod/Router::Boom&quot;&gt;Router::Boom&lt;/a&gt; and &lt;a href=&quot;https://metacpan.org/pod/Router::R3&quot;&gt;Router::R3&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
There are &lt;a href=&quot;https://github.com/CindyLinz/Perl-Router-R3/blob/master/scripts/routes.pl&quot;&gt;over 3 hundred generated routing paths&lt;/a&gt; in &lt;a href=&quot;https://github.com/CindyLinz/Perl-Router-R3/blob/master/scripts/benchmark.pl&quot;&gt;the benchmark script&lt;/a&gt;. we tested the &quot;plain string matching&quot; with the route in the middle of the list, and also the first route matching, regular expression matching.&lt;br /&gt;
&lt;br /&gt;
Here comes the dispatching speed result:&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: black; font-family: &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 20px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;div class=&quot;syntaxhighlighter nogutter highlight pl&quot; id=&quot;highlighter_563364&quot; style=&quot;background-color: #fafafa; border: 1px solid rgb(233, 233, 233); font-size: 1em !important; margin: 1em 0px !important; overflow-x: auto !important; overflow-y: hidden !important; padding: 10px; position: relative !important; width: auto !important;&quot;&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;background: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-collapse: collapse; border-spacing: 0px; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace !important; font-size: 1em !important; font-style: normal !important; font-weight: normal !important; height: auto !important; left: auto !important; line-height: 1.2em !important; margin: 0px !important; max-width: 100%; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: 1338px;&quot;&gt;&lt;tbody style=&quot;background: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace !important; font-size: 1em !important; font-style: normal !important; font-weight: normal !important; height: auto !important; left: auto !important; line-height: 1.2em !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;
&lt;tr style=&quot;background: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace !important; font-size: 1em !important; font-style: normal !important; font-weight: normal !important; height: auto !important; left: auto !important; line-height: 1.2em !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;&lt;td class=&quot;code&quot; style=&quot;background: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace !important; font-size: 1em !important; font-style: normal !important; font-weight: normal !important; height: auto !important; left: auto !important; line-height: 1.2em !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: 1338px;&quot;&gt;&lt;div class=&quot;container&quot; style=&quot;background: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace !important; font-size: 1em !important; font-style: normal !important; font-weight: normal !important; height: auto !important; left: auto !important; line-height: 1.2em !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: relative !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;
&lt;div class=&quot;line number1 index0 alt2&quot; style=&quot;background: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace !important; font-size: 1em !important; font-style: normal !important; font-weight: normal !important; height: auto !important; left: auto !important; line-height: 1.2em !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em 0px 0em !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;&quot;&gt;
&lt;code class=&quot;pl plain&quot; style=&quot;background: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: black !important; float: none !important; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace !important; font-size: 1em !important; font-style: normal !important; font-weight: normal !important; height: auto !important; left: auto !important; line-height: 1.2em !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; white-space: nowrap; width: auto !important;&quot;&gt;Benchmarking&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;pl string&quot; style=&quot;background: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: blue !important; float: none !important; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace !important; font-size: 1em !important; font-style: normal !important; font-weight: normal !important; height: auto !important; left: auto !important; line-height: 1.2em !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; white-space: nowrap; width: auto !important;&quot;&gt;&#39;plain string matching&#39;&lt;/code&gt; &lt;code class=&quot;pl plain&quot; style=&quot;background: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: black !important; float: none !important; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace !important; font-size: 1em !important; font-style: normal !important; font-weight: normal !important; height: auto !important; left: auto !important; line-height: 1.2em !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; white-space: nowrap; width: auto !important;&quot;&gt;by path&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;pl string&quot; style=&quot;background: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: blue !important; float: none !important; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace !important; font-size: 1em !important; font-style: normal !important; font-weight: normal !important; height: auto !important; left: auto !important; line-height: 1.2em !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; white-space: nowrap; width: auto !important;&quot;&gt;&#39;/corge/quux/bar&#39;&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number2 index1 alt1&quot; style=&quot;background: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace !important; font-size: 1em !important; font-style: normal !important; font-weight: normal !important; height: auto !important; left: auto !important; line-height: 1.2em !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em 0px 0em !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;&quot;&gt;
&lt;code class=&quot;pl plain&quot; style=&quot;background: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: black !important; float: none !important; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace !important; font-size: 1em !important; font-style: normal !important; font-weight: normal !important; height: auto !important; left: auto !important; line-height: 1.2em !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; white-space: nowrap; width: auto !important;&quot;&gt;===============================================================&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number3 index2 alt2&quot; style=&quot;background: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace !important; font-size: 1em !important; font-style: normal !important; font-weight: normal !important; height: auto !important; left: auto !important; line-height: 1.2em !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em 0px 0em !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;&quot;&gt;
&lt;code class=&quot;pl spaces&quot; style=&quot;background: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: inherit; float: none !important; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace !important; font-size: 1em !important; font-style: normal !important; font-weight: normal !important; height: auto !important; left: auto !important; line-height: 1.2em !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; white-space: nowrap; width: auto !important;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;pl plain&quot; style=&quot;background: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: black !important; float: none !important; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace !important; font-size: 1em !important; font-style: normal !important; font-weight: normal !important; height: auto !important; left: auto !important; line-height: 1.2em !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; white-space: nowrap; width: auto !important;&quot;&gt;Rate&amp;nbsp; HTTP::Router Router::Simple&amp;nbsp; Router::Boom&amp;nbsp;&amp;nbsp;&amp;nbsp; Router::R3&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number4 index3 alt1&quot; style=&quot;background: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace !important; font-size: 1em !important; font-style: normal !important; font-weight: normal !important; height: auto !important; left: auto !important; line-height: 1.2em !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em 0px 0em !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;&quot;&gt;
&lt;code class=&quot;pl plain&quot; style=&quot;background: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: black !important; float: none !important; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace !important; font-size: 1em !important; font-style: normal !important; font-weight: normal !important; height: auto !important; left: auto !important; line-height: 1.2em !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; white-space: nowrap; width: auto !important;&quot;&gt;HTTP::Router&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 203/s&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; --&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -89%&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -100%&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -100%&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number5 index4 alt2&quot; style=&quot;background: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace !important; font-size: 1em !important; font-style: normal !important; font-weight: normal !important; height: auto !important; left: auto !important; line-height: 1.2em !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em 0px 0em !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;&quot;&gt;
&lt;code class=&quot;pl plain&quot; style=&quot;background: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: black !important; float: none !important; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace !important; font-size: 1em !important; font-style: normal !important; font-weight: normal !important; height: auto !important; left: auto !important; line-height: 1.2em !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; white-space: nowrap; width: auto !important;&quot;&gt;Router::Simple&amp;nbsp;&amp;nbsp; 1782/s&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 779%&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; --&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -99%&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -100%&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number6 index5 alt1&quot; style=&quot;background: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace !important; font-size: 1em !important; font-style: normal !important; font-weight: normal !important; height: auto !important; left: auto !important; line-height: 1.2em !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em 0px 0em !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;&quot;&gt;
&lt;code class=&quot;pl plain&quot; style=&quot;background: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: black !important; float: none !important; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace !important; font-size: 1em !important; font-style: normal !important; font-weight: normal !important; height: auto !important; left: auto !important; line-height: 1.2em !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; white-space: nowrap; width: auto !important;&quot;&gt;Router::Boom&amp;nbsp;&amp;nbsp; 168658/s&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 83094%&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 9365%&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; --&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -82%&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number7 index6 alt2&quot; style=&quot;background: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace !important; font-size: 1em !important; font-style: normal !important; font-weight: normal !important; height: auto !important; left: auto !important; line-height: 1.2em !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em 0px 0em !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;&quot;&gt;
&lt;code class=&quot;pl plain&quot; style=&quot;background: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: black !important; float: none !important; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace !important; font-size: 1em !important; font-style: normal !important; font-weight: normal !important; height: auto !important; left: auto !important; line-height: 1.2em !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; white-space: nowrap; width: auto !important;&quot;&gt;Router::R3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 954407/s&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 470684%&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 53461%&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 466%&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; --&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number8 index7 alt1&quot; style=&quot;background: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace !important; font-size: 1em !important; font-style: normal !important; font-weight: normal !important; height: auto !important; left: auto !important; line-height: 1.2em !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em 0px 0em !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;line number9 index8 alt2&quot; style=&quot;background: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace !important; font-size: 1em !important; font-style: normal !important; font-weight: normal !important; height: auto !important; left: auto !important; line-height: 1.2em !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em 0px 0em !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;&quot;&gt;
&lt;code class=&quot;pl plain&quot; style=&quot;background: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: black !important; float: none !important; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace !important; font-size: 1em !important; font-style: normal !important; font-weight: normal !important; height: auto !important; left: auto !important; line-height: 1.2em !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; white-space: nowrap; width: auto !important;&quot;&gt;Benchmarking&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;pl string&quot; style=&quot;background: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: blue !important; float: none !important; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace !important; font-size: 1em !important; font-style: normal !important; font-weight: normal !important; height: auto !important; left: auto !important; line-height: 1.2em !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; white-space: nowrap; width: auto !important;&quot;&gt;&#39;regexp string matching&#39;&lt;/code&gt; &lt;code class=&quot;pl plain&quot; style=&quot;background: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: black !important; float: none !important; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace !important; font-size: 1em !important; font-style: normal !important; font-weight: normal !important; height: auto !important; left: auto !important; line-height: 1.2em !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; white-space: nowrap; width: auto !important;&quot;&gt;by path&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;pl string&quot; style=&quot;background: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: blue !important; float: none !important; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace !important; font-size: 1em !important; font-style: normal !important; font-weight: normal !important; height: auto !important; left: auto !important; line-height: 1.2em !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; white-space: nowrap; width: auto !important;&quot;&gt;&#39;/post/2012/03&#39;&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number10 index9 alt1&quot; style=&quot;background: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace !important; font-size: 1em !important; font-style: normal !important; font-weight: normal !important; height: auto !important; left: auto !important; line-height: 1.2em !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em 0px 0em !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;&quot;&gt;
&lt;code class=&quot;pl plain&quot; style=&quot;background: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: black !important; float: none !important; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace !important; font-size: 1em !important; font-style: normal !important; font-weight: normal !important; height: auto !important; left: auto !important; line-height: 1.2em !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; white-space: nowrap; width: auto !important;&quot;&gt;===============================================================&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number11 index10 alt2&quot; style=&quot;background: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace !important; font-size: 1em !important; font-style: normal !important; font-weight: normal !important; height: auto !important; left: auto !important; line-height: 1.2em !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em 0px 0em !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;&quot;&gt;
&lt;code class=&quot;pl spaces&quot; style=&quot;background: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: inherit; float: none !important; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace !important; font-size: 1em !important; font-style: normal !important; font-weight: normal !important; height: auto !important; left: auto !important; line-height: 1.2em !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; white-space: nowrap; width: auto !important;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;pl plain&quot; style=&quot;background: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: black !important; float: none !important; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace !important; font-size: 1em !important; font-style: normal !important; font-weight: normal !important; height: auto !important; left: auto !important; line-height: 1.2em !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; white-space: nowrap; width: auto !important;&quot;&gt;Rate&amp;nbsp; HTTP::Router Router::Simple&amp;nbsp; Router::Boom&amp;nbsp;&amp;nbsp;&amp;nbsp; Router::R3&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number12 index11 alt1&quot; style=&quot;background: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace !important; font-size: 1em !important; font-style: normal !important; font-weight: normal !important; height: auto !important; left: auto !important; line-height: 1.2em !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em 0px 0em !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;&quot;&gt;
&lt;code class=&quot;pl plain&quot; style=&quot;background: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: black !important; float: none !important; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace !important; font-size: 1em !important; font-style: normal !important; font-weight: normal !important; height: auto !important; left: auto !important; line-height: 1.2em !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; white-space: nowrap; width: auto !important;&quot;&gt;HTTP::Router&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1076/s&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; --&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -88%&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -99%&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -100%&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number13 index12 alt2&quot; style=&quot;background: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace !important; font-size: 1em !important; font-style: normal !important; font-weight: normal !important; height: auto !important; left: auto !important; line-height: 1.2em !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em 0px 0em !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;&quot;&gt;
&lt;code class=&quot;pl plain&quot; style=&quot;background: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: black !important; float: none !important; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace !important; font-size: 1em !important; font-style: normal !important; font-weight: normal !important; height: auto !important; left: auto !important; line-height: 1.2em !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; white-space: nowrap; width: auto !important;&quot;&gt;Router::Simple&amp;nbsp;&amp;nbsp; 9309/s&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 765%&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; --&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -91%&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -97%&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number14 index13 alt1&quot; style=&quot;background: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace !important; font-size: 1em !important; font-style: normal !important; font-weight: normal !important; height: auto !important; left: auto !important; line-height: 1.2em !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em 0px 0em !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;&quot;&gt;
&lt;code class=&quot;pl plain&quot; style=&quot;background: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: black !important; float: none !important; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace !important; font-size: 1em !important; font-style: normal !important; font-weight: normal !important; height: auto !important; left: auto !important; line-height: 1.2em !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; white-space: nowrap; width: auto !important;&quot;&gt;Router::Boom&amp;nbsp;&amp;nbsp; 104387/s&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 9602%&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1021%&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; --&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -66%&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number15 index14 alt2&quot; style=&quot;background: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace !important; font-size: 1em !important; font-style: normal !important; font-weight: normal !important; height: auto !important; left: auto !important; line-height: 1.2em !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em 0px 0em !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;&quot;&gt;
&lt;code class=&quot;pl plain&quot; style=&quot;background: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: black !important; float: none !important; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace !important; font-size: 1em !important; font-style: normal !important; font-weight: normal !important; height: auto !important; left: auto !important; line-height: 1.2em !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; white-space: nowrap; width: auto !important;&quot;&gt;Router::R3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 306925/s&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 28426%&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3197%&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 194%&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; --&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number16 index15 alt1&quot; style=&quot;background: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace !important; font-size: 1em !important; font-style: normal !important; font-weight: normal !important; height: auto !important; left: auto !important; line-height: 1.2em !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em 0px 0em !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;line number17 index16 alt2&quot; style=&quot;background: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace !important; font-size: 1em !important; font-style: normal !important; font-weight: normal !important; height: auto !important; left: auto !important; line-height: 1.2em !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em 0px 0em !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;&quot;&gt;
&lt;code class=&quot;pl plain&quot; style=&quot;background: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: black !important; float: none !important; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace !important; font-size: 1em !important; font-style: normal !important; font-weight: normal !important; height: auto !important; left: auto !important; line-height: 1.2em !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; white-space: nowrap; width: auto !important;&quot;&gt;Benchmarking&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;pl string&quot; style=&quot;background: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: blue !important; float: none !important; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace !important; font-size: 1em !important; font-style: normal !important; font-weight: normal !important; height: auto !important; left: auto !important; line-height: 1.2em !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; white-space: nowrap; width: auto !important;&quot;&gt;&#39;first charactar matching&#39;&lt;/code&gt; &lt;code class=&quot;pl plain&quot; style=&quot;background: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: black !important; float: none !important; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace !important; font-size: 1em !important; font-style: normal !important; font-weight: normal !important; height: auto !important; left: auto !important; line-height: 1.2em !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; white-space: nowrap; width: auto !important;&quot;&gt;by path&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;pl string&quot; style=&quot;background: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: blue !important; float: none !important; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace !important; font-size: 1em !important; font-style: normal !important; font-weight: normal !important; height: auto !important; left: auto !important; line-height: 1.2em !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; white-space: nowrap; width: auto !important;&quot;&gt;&#39;/&#39;&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number18 index17 alt1&quot; style=&quot;background: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace !important; font-size: 1em !important; font-style: normal !important; font-weight: normal !important; height: auto !important; left: auto !important; line-height: 1.2em !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em 0px 0em !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;&quot;&gt;
&lt;code class=&quot;pl plain&quot; style=&quot;background: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: black !important; float: none !important; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace !important; font-size: 1em !important; font-style: normal !important; font-weight: normal !important; height: auto !important; left: auto !important; line-height: 1.2em !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; white-space: nowrap; width: auto !important;&quot;&gt;===============================================================&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number19 index18 alt2&quot; style=&quot;background: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace !important; font-size: 1em !important; font-style: normal !important; font-weight: normal !important; height: auto !important; left: auto !important; line-height: 1.2em !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em 0px 0em !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;&quot;&gt;
&lt;code class=&quot;pl spaces&quot; style=&quot;background: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: inherit; float: none !important; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace !important; font-size: 1em !important; font-style: normal !important; font-weight: normal !important; height: auto !important; left: auto !important; line-height: 1.2em !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; white-space: nowrap; width: auto !important;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;pl plain&quot; style=&quot;background: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: black !important; float: none !important; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace !important; font-size: 1em !important; font-style: normal !important; font-weight: normal !important; height: auto !important; left: auto !important; line-height: 1.2em !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; white-space: nowrap; width: auto !important;&quot;&gt;Rate&amp;nbsp; HTTP::Router Router::Simple Router::Boom&amp;nbsp;&amp;nbsp;&amp;nbsp; Router::R3&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number20 index19 alt1&quot; style=&quot;background: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace !important; font-size: 1em !important; font-style: normal !important; font-weight: normal !important; height: auto !important; left: auto !important; line-height: 1.2em !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em 0px 0em !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;&quot;&gt;
&lt;code class=&quot;pl plain&quot; style=&quot;background: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: black !important; float: none !important; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace !important; font-size: 1em !important; font-style: normal !important; font-weight: normal !important; height: auto !important; left: auto !important; line-height: 1.2em !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; white-space: nowrap; width: auto !important;&quot;&gt;HTTP::Router&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3839/s&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; --&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -87%&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -98%&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -100%&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number21 index20 alt2&quot; style=&quot;background: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace !important; font-size: 1em !important; font-style: normal !important; font-weight: normal !important; height: auto !important; left: auto !important; line-height: 1.2em !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em 0px 0em !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;&quot;&gt;
&lt;code class=&quot;pl plain&quot; style=&quot;background: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: black !important; float: none !important; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace !important; font-size: 1em !important; font-style: normal !important; font-weight: normal !important; height: auto !important; left: auto !important; line-height: 1.2em !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; white-space: nowrap; width: auto !important;&quot;&gt;Router::Simple&amp;nbsp;&amp;nbsp; 30545/s&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 696%&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; --&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -83%&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -98%&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number22 index21 alt1&quot; style=&quot;background: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace !important; font-size: 1em !important; font-style: normal !important; font-weight: normal !important; height: auto !important; left: auto !important; line-height: 1.2em !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em 0px 0em !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;&quot;&gt;
&lt;code class=&quot;pl plain&quot; style=&quot;background: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: black !important; float: none !important; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace !important; font-size: 1em !important; font-style: normal !important; font-weight: normal !important; height: auto !important; left: auto !important; line-height: 1.2em !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; white-space: nowrap; width: auto !important;&quot;&gt;Router::Boom&amp;nbsp;&amp;nbsp;&amp;nbsp; 180555/s&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4603%&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 491%&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; --&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -88%&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number23 index22 alt2&quot; style=&quot;background: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace !important; font-size: 1em !important; font-style: normal !important; font-weight: normal !important; height: auto !important; left: auto !important; line-height: 1.2em !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em 0px 0em !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;&quot;&gt;
&lt;code class=&quot;pl plain&quot; style=&quot;background: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: black !important; float: none !important; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace !important; font-size: 1em !important; font-style: normal !important; font-weight: normal !important; height: auto !important; left: auto !important; line-height: 1.2em !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; white-space: nowrap; width: auto !important;&quot;&gt;Router::R3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1535999/s&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 39910%&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4929%&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 751%&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; --&lt;/code&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://c9s.blogspot.com/feeds/1277911297933642968/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://c9s.blogspot.com/2014/06/perl-url-router-benchmarks.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3147036244016021082/posts/default/1277911297933642968'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3147036244016021082/posts/default/1277911297933642968'/><link rel='alternate' type='text/html' href='http://c9s.blogspot.com/2014/06/perl-url-router-benchmarks.html' title='Perl URL Router Benchmarks'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/05514217676033260267</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/-qVaWczE6JLM/U5cA0aGo7FI/AAAAAAAALc8/ITcRr4vIAEo/s72-c/Screen+Shot+2014-06-10+at+20.57.30.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3147036244016021082.post-7481926631151635177</id><published>2014-06-10T16:47:00.001+08:00</published><updated>2014-06-10T16:47:36.930+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Microsoft Keyboard"/><title type='text'>評 Microsoft Sculpt 人體工學鍵盤 (Microsoft Sculpt Ergonomic Keyboard)</title><content type='html'>Microsoft Sculpt Keyboard 在造型上及人體工學上的設計實在無懈可擊。 但有幾個缺點造成相當多的不便:&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
1. Dongle 只能貼在滑鼠上，所以如果要帶鍵盤外出，就得連滑鼠一起帶。不然就是得把 Dongle 放口袋或其他地方，加上 Dongle 太小了... 非常容易弄不見。&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;根據 HLB 的敘述，Dongle 弄不見之後竟然沒有辦法維修或另外購買!!! 就算你願意花錢買 Dongle 也不行!&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
2. 鍵盤帶著外出，由於完全沒有電源開關，所以只要壓到鍵盤，就會造成電量損失，放上一整天隔天就會沒電! 所以帶著外出時，還要先把電池全部卸下........&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://c9s.blogspot.com/feeds/7481926631151635177/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://c9s.blogspot.com/2014/06/microsoft-sculpt-microsoft-sculpt.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3147036244016021082/posts/default/7481926631151635177'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3147036244016021082/posts/default/7481926631151635177'/><link rel='alternate' type='text/html' href='http://c9s.blogspot.com/2014/06/microsoft-sculpt-microsoft-sculpt.html' title='評 Microsoft Sculpt 人體工學鍵盤 (Microsoft Sculpt Ergonomic Keyboard)'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/05514217676033260267</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3147036244016021082.post-1015884049464167964</id><published>2014-05-21T20:08:00.004+08:00</published><updated>2014-05-22T11:02:58.782+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="c"/><category scheme="http://www.blogger.com/atom/ns#" term="dfa"/><category scheme="http://www.blogger.com/atom/ns#" term="Perl"/><category scheme="http://www.blogger.com/atom/ns#" term="prefix tree"/><category scheme="http://www.blogger.com/atom/ns#" term="Router"/><category scheme="http://www.blogger.com/atom/ns#" term="trie"/><title type='text'>R3 - 極致效能的 URL Router Library </title><content type='html'>其實幾年前就有想用 DFA 做 URL router 的想法，只是為了有趣，所以當時用 PHP 寫了一個簡單的 RE parser，但是用 PHP 寫成的 parser 實在太醜了，而且在動態語言裡面這樣實作也不會快到哪裡去，於是後來就作罷。&lt;br /&gt;
&lt;br /&gt;
當時也另外看了 Journey 的原始碼，發現 Rails/Journey 在處理 Regular Expression 的路徑比對也只是把一整個 Regular Expression 路徑放到另外一個 array 裡面去循序比對罷了，並不會塞到 DFA 裡面.... 看到這邊其實就想丟鍵盤了，如果你只有 字串拿來做 DFA，那倒不如就直接用 Ruby 內建的 Hash Table 查表算了。&lt;br /&gt;
&lt;br /&gt;
後來一直沒有動機繼續把這個想法做完，一方面，用 C parsing regular expression 實在太累人，且就算實作了，考量到開發時間有限，也不可能完整支援所有的 RE features，所以就折衷先寫了一個非常 Tiny 的 library - Pux 來解決 PHP + Nginx/Apache routing overhead 的問題。&lt;br /&gt;
&lt;br /&gt;
再後來，有次跟 Cindy 討論發現其實可以用 prefix/suffix tree 來做比對。而 prefix tree 很適合這個問題。但 RE 還是沒有辦法很完美的整合進來。&lt;br /&gt;
&lt;br /&gt;
睡了一晚，想到 RE 其實可以拆成個別的 node 做 partial match 即可，這樣就可以用很簡單的資料結構的解決掉問題，不用自己做 Regular Expression 的引擎，只要把部分字串交給 PCRE 接手即可，而且還可以得到非常不錯的效能。&lt;br /&gt;
&lt;br /&gt;
後來用了一些零零碎碎的時間總算把雛形寫完了，接著就拿 stevegraham/rails 的 PR 裡的測試資料簡單評測了一下。發現新引擎處理比對的速度，每秒約可以處理一千兩百萬到一千三百萬個路徑 (12M~13M) 比對 ( &lt;a href=&quot;http://l.facebook.com/l.php?u=http%3A%2F%2Fc9s.github.io%2Fr3%2Fbench.html&amp;amp;h=gAQEsHQlk&amp;amp;s=1&quot;&gt;http://c9s.github.io/r3/bench.html&lt;/a&gt; ) ，而 Journey 約處理九千個路徑左右 (約一千多倍的差異)。&lt;br /&gt;
&lt;br /&gt;
現在，只要是 3P 語言都可以透過跟 R3 binding 得到相當不錯的效能！歡迎大家來實作 R3 &amp;nbsp;binding:&lt;br /&gt;
&lt;br /&gt;
專案網址: &lt;a href=&quot;http://l.facebook.com/l.php?u=http%3A%2F%2Fgithub.com%2Fc9s%2Fr3&amp;amp;h=9AQFYR16x&amp;amp;s=1&quot;&gt;http://github.com/c9s/r3&lt;/a&gt;&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
目前 Cindy 寫的 Perl 版本的 R3 CPAN module 已經放上 CPAN :&lt;a href=&quot;https://metacpan.org/pod/Router::R3&quot;&gt;https://metacpan.org/pod/Router::R3&lt;/a&gt; &lt;br /&gt;
&lt;br /&gt;
當 Rails/Journey 還在 9326 i/s 繞，Perl 版的 R3 跑起來就有 1,662,383 i/s。&lt;br /&gt;
&lt;br /&gt;
當然你可能會說，Router 有需要這麼快嗎？Well 其實這個專案基本上只是為了實驗加興趣而實作的，雖是實驗，但所有的 Feature 都透過 C 的 Check Unit Testing 做測試，使用 autotools 做 feature testing, project building。&lt;br /&gt;
&lt;br /&gt;
R3 後續在 Hacker News 以及 Twitter 上引起討論。 如:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;twitter-tweet&quot; lang=&quot;en&quot;&gt;
XSで書かれたRouter / “Router::R3 - URL router library with high performance - &lt;a href=&quot;http://t.co/heRX9PCJDC&quot;&gt;http://t.co/heRX9PCJDC&lt;/a&gt;” &lt;a href=&quot;http://t.co/TeIY1FQiSD&quot;&gt;http://t.co/TeIY1FQiSD&lt;/a&gt;&lt;br /&gt;
— mattn (@mattn_jp) &lt;a href=&quot;https://twitter.com/mattn_jp/statuses/469001351180324864&quot;&gt;May 21, 2014&lt;/a&gt;&lt;/blockquote&gt;
&lt;br /&gt;
&lt;script async=&quot;&quot; charset=&quot;utf-8&quot; src=&quot;//platform.twitter.com/widgets.js&quot;&gt;&lt;/script&gt;&lt;br /&gt;
日本的 mattn san 也做了一份 Perl Router 的 Benchmark，與號稱最快的 Perl Router Module 比較:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;twitter-tweet&quot; lang=&quot;en&quot;&gt;
&lt;a href=&quot;https://twitter.com/miyagawa&quot;&gt;@miyagawa&lt;/a&gt; &lt;a href=&quot;https://twitter.com/tokuhirom&quot;&gt;@tokuhirom&lt;/a&gt; フェアかどうかは分からないけど、まぁまぁ速いっぽい。 &lt;a href=&quot;https://t.co/SdNYvGVy45&quot;&gt;https://t.co/SdNYvGVy45&lt;/a&gt;&lt;br /&gt;
— mattn (@mattn_jp) &lt;a href=&quot;https://twitter.com/mattn_jp/statuses/469038098962083840&quot;&gt;May 21, 2014&lt;/a&gt;&lt;/blockquote&gt;
&lt;br /&gt;
&lt;script async=&quot;&quot; charset=&quot;utf-8&quot; src=&quot;//platform.twitter.com/widgets.js&quot;&gt;&lt;/script&gt;</content><link rel='replies' type='application/atom+xml' href='http://c9s.blogspot.com/feeds/1015884049464167964/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://c9s.blogspot.com/2014/05/r3-url-router-library.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3147036244016021082/posts/default/1015884049464167964'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3147036244016021082/posts/default/1015884049464167964'/><link rel='alternate' type='text/html' href='http://c9s.blogspot.com/2014/05/r3-url-router-library.html' title='R3 - 極致效能的 URL Router Library '/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/05514217676033260267</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3147036244016021082.post-1059065451187633908</id><published>2014-05-15T08:35:00.001+08:00</published><updated>2014-05-15T08:35:47.256+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Hash Table"/><category scheme="http://www.blogger.com/atom/ns#" term="Judy Array"/><title type='text'></title><content type='html'>Judy array 在 2003 年時似乎是當時最快的 associative array 實作.. 當時好像掀起了一番熱潮.. 查了一下現在好像也有其他 hash table / associative array 比 Judy array 快。&lt;br /&gt;
&lt;br /&gt;
有翻到 benchmark project 測 PHP 內建的 Array, SplFixedArray, Judy Array，結果 Array 居然表現跟 Judy Array 不相上下？不知道是不是因為 Language runtime 轉型 overhead 的關係？&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://c9s.blogspot.com/feeds/1059065451187633908/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://c9s.blogspot.com/2014/05/judy-array-2003-associative-array.html#comment-form' title='1 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3147036244016021082/posts/default/1059065451187633908'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3147036244016021082/posts/default/1059065451187633908'/><link rel='alternate' type='text/html' href='http://c9s.blogspot.com/2014/05/judy-array-2003-associative-array.html' title=''/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/05514217676033260267</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3147036244016021082.post-8462690472644849797</id><published>2014-05-10T20:32:00.000+08:00</published><updated>2014-05-10T20:32:11.221+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="API"/><category scheme="http://www.blogger.com/atom/ns#" term="Polymorphism"/><category scheme="http://www.blogger.com/atom/ns#" term="介面"/><category scheme="http://www.blogger.com/atom/ns#" term="多型"/><title type='text'></title><content type='html'>動態語言裡設計函式介面越要彈性簡單好用，就需要實作 Runtime 的 type checking，執行時期會增加更多的計算成本。&lt;br /&gt;
&lt;br /&gt;
程式語言如 C++, Haskell 可以透過 Parametric polymorphism 多型的方式提高介面易用度，編譯時期就可以確定要呼叫哪個符合類型的函式。&lt;br /&gt;
&lt;br /&gt;
很不幸的，動態語言如 PHP, JavaScript, Ruby 不支援多型，就只能用 instanceof, typeof, is_a? 等方式來檢查型別，這時候 trade off 就來了，你希望函式要 &quot;Less is more&quot; 還是要 &quot;說清楚吃雞豬牛或鴨&quot; ?&lt;br /&gt;
&lt;br /&gt;
前者好用但計算成本高，後者麻煩但計算成本低。這就是 jQuery 為什麼慢，而有些人堅持用 document.getElementById 的原因。&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://c9s.blogspot.com/feeds/8462690472644849797/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://c9s.blogspot.com/2014/05/runtime-type-checking-c-haskell.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3147036244016021082/posts/default/8462690472644849797'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3147036244016021082/posts/default/8462690472644849797'/><link rel='alternate' type='text/html' href='http://c9s.blogspot.com/2014/05/runtime-type-checking-c-haskell.html' title=''/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/05514217676033260267</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3147036244016021082.post-5508196440389107799</id><published>2014-05-08T07:47:00.002+08:00</published><updated>2014-05-15T08:36:15.661+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="張榮發"/><title type='text'></title><content type='html'>利用通勤等零碎時間讀張榮發回憶錄，內心澎湃不已。張總裁從蘇澳貧困的家中出生，歷經語言隔閡，18歲喪父，扛起扶養弟妹的責任，拼命苦讀考取船副，之後創立船公司，準確預測國際趨勢，並成為成為國際中首度使用貨櫃輪的船公司，在 GPS 還在美軍試驗時，就率先採用 GPS 作為貨櫃輪的導航系統；搭飛機的時候還用皮尺帳量機內座位間距、尺寸等..一直做到七八十歲才退休！長榮國際企業的成功真的不是偶然，誰有資格說企業家成功都是靠爸？&lt;br /&gt;
&lt;br /&gt;
發現所謂有決心、超強意志、有智慧的企業家，是絕不提”夢想”兩字，他們只專注當下，對未來沒有妄想，克服眼前的困境，紮實的走好每一步路。&lt;br /&gt;
&lt;br /&gt;
自我期許之</content><link rel='replies' type='application/atom+xml' href='http://c9s.blogspot.com/feeds/5508196440389107799/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://c9s.blogspot.com/2014/05/blog-post.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3147036244016021082/posts/default/5508196440389107799'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3147036244016021082/posts/default/5508196440389107799'/><link rel='alternate' type='text/html' href='http://c9s.blogspot.com/2014/05/blog-post.html' title=''/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/05514217676033260267</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3147036244016021082.post-4019214030236538292</id><published>2014-05-07T01:00:00.000+08:00</published><updated>2014-05-07T01:03:20.945+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Php"/><category scheme="http://www.blogger.com/atom/ns#" term="老皮帶隊亂亂翻"/><title type='text'>重構 PHP 引擎並大幅改善效能 - PHP Mailing List</title><content type='html'>&lt;br /&gt;
譯文 Hackpad: &lt;a href=&quot;https://hackpad.com/-PHP--HRY9UYvrArM&quot;&gt;https://hackpad.com/-PHP--HRY9UYvrArM&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
原文網址: &lt;a href=&quot;http://news.php.net/php.internals/73888&quot;&gt;http://news.php.net/php.internals/73888&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
認識我的人們都知道我在 Zend 主要的責任及熱情都放在 PHP 效能這個主題上。 事實上，從 PHP 5.0 版本開始，我們已經在綜合性效能評比 (Benchmark) 上改善了六倍的速度，並且讓一般使用 PHP 撰寫的應用程式達到了兩倍速度改善。&lt;br /&gt;
&lt;br /&gt;
我們不停的改善 PHP 引擎以及 OPCache (PHP 5.5 版的核心套件，用於快取)。 然而，當時對於 PHP 5.5 版本的釋出，我們並無顯著的發展，除了別的事情之外，我們也試驗了一些記憶體管理, JIT 技術等其他可能的辦法。&lt;br /&gt;
&lt;br /&gt;
我花了相當多的時間試驗 JIT 的想法，並證實這是可行的 (以 LLVM 為基礎的 JIT 編譯器，然後嵌入 OPCache)。 由 bench.php 得到的結果相當驚人 -- (由原本的 2.175 秒改善為 0.219 秒 -- PHP 5.5 近十倍速度的改善)，但在現實的應用程式中，我們只得到了一些加速。 但這讓我們更深入的探索 PHP 引擎執行時期 (Runtime) 的特性以及那些真正的瓶頸，來取得巨大的進展。&lt;br /&gt;
&lt;br /&gt;
很明顯的 VM 幾乎已經高度優化了，但是卻內部所使用的資料結構卻需要使用大量的記憶體調用 (Allocation)、釋放 (Deallocation)、參照計算 (Reference Counting)。&lt;br /&gt;
&lt;br /&gt;
一般來說，現實生活中的 PHP 應用程式花了約 20% 的 CPU 實在在記憶體管理 (memory management)、10% 做雜湊表 (Hash Table) 操作、30% 呼叫內部函式 (Internal functions) 且只有 30% 花在虛擬機器 (VM) 上。&lt;br /&gt;
&lt;br /&gt;
當然，我們嘗試了將 VM code 用 JIT-only 的方式運行，在大多數的狀況下，他還是花了同樣多的記憶體配置。因此，我們決定著重在最主要的效能瓶頸上。 主要的想法是修改內部的資料類型 (data types) 並最小化堆積 (Heap) 的用量。 &lt;br /&gt;
&lt;br /&gt;
這是一個相當困難的決定，因為我們必須重構相當大量的程式碼，而且我們完全不知道重構之後是否會造成其他問題或衝擊。&lt;br /&gt;
&lt;br /&gt;
現在我可榮幸的向您們展示這四個月以來的工作成果。這次的 PHP 引擎重構大量的改善了效能、記憶體用量，並且為未來的效能改善及 JIT 建立了穩固的基礎。我會避免技術細節（更多細節將會在 &lt;a href=&quot;http://wiki.php.net/phpng&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://wiki.php.net/phpng&quot;&gt;http://wiki.php.net/phpng&lt;/a&gt; &amp;lt;&lt;a href=&quot;http://wiki.php.net/phpng&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://wiki.php.net/phpng&quot;&gt;http://wiki.php.net/phpng&lt;/a&gt;&amp;gt;* 發佈），簡單的說 - 我們改變了整棟建築物的地基並且盡量保持建築本身不改變。現在新的引擎已經達成了 *10-30% 左右的加速，且不只是在效能評比 (Benchmark) 中，在現實應用程式也達成了相同的加速!&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
以下是我們目前所達成的效能改善:&lt;br /&gt;
&lt;div&gt;
&lt;ul class=&quot;code&quot;&gt;
&lt;li style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-transform: none; white-space: normal; word-spacing: 0px;&quot;&gt;Wordpress 3.6 – 20.0% gain (253 vs 211 req/sec)&lt;/li&gt;
&lt;li style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-transform: none; white-space: normal; word-spacing: 0px;&quot;&gt;Drupal 6.1 – 11.7% gain (1770 vs 1585 req/sec&lt;/li&gt;
&lt;li style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-transform: none; white-space: normal; word-spacing: 0px;&quot;&gt;Qdig – 15.3% gain (555 vs 482 req/sec)&lt;/li&gt;
&lt;li style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-transform: none; white-space: normal; word-spacing: 0px;&quot;&gt;ZF test app – 30.5% gain (217 vs 166 req/sec)&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
在某些應用程式中，我們相較於其他 PHP 實作得到了更好的結果。 若有其他人能夠測試他們的應用程式，並且與目前使用的 PHP 版本的效能比較，整理更多的效能差異結果，那就更好了。&lt;br /&gt;
&lt;br /&gt;
這次的重構還未完成，因為我們一開始只是測試這樣的修改是否能得到改善。 目前並不是所有的延伸套件 (Extension) 都得到支持，有一些單元測試是失敗的，此外，我們對於其他改善也還有更多想法。&lt;br /&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;br /&gt;
但我們覺得，現有的結果已經足以證實改善的方向，且可以開放出來讓大家檢視、回饋或協助，如我們現在有了正確的方向，我們也想儘快讓社群參與。 &lt;br /&gt;
&lt;br /&gt;
因為，要支持所有的延伸套件 (Extension) 以及持續的做出更多改善，還有許多工作需要完成，這些也需要社群的協助。&lt;/div&gt;
&lt;div&gt;
請嘗試這個重構過的 PHP 引擎並且提供我們意見或結果，像是: 效能, 記憶體用量或任何的想法。 你可以在 php.net 上的 *phpng* 這個開發分支上找到這個新版的 PHP。&lt;br /&gt;
&lt;br /&gt;
建置步驟則在: &lt;a href=&quot;http://wiki.php.net/phpng&quot;&gt;http://wiki.php.net/phpng&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
如同我們上面提到的，有一些 Extension 還未被支援，因此並不是所有的東西都可以運作。&lt;br /&gt;
&lt;br /&gt;
我想要感謝 Xhinchin 以及 Nikita ，他們完成了這次的成果許多重要的部份。&lt;br /&gt;
&lt;br /&gt;
謝謝。 Dmitry。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-- 林佑安譯於 2014 五月&lt;/div&gt;
&lt;/div&gt;
&lt;ul class=&quot;code&quot; style=&quot;font-family: Helvetica;&quot;&gt;&lt;/ul&gt;
&lt;/div&gt;
&lt;ul class=&quot;code&quot; style=&quot;font-family: Helvetica;&quot;&gt;&lt;/ul&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://c9s.blogspot.com/feeds/4019214030236538292/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://c9s.blogspot.com/2014/05/php-php-mailing-list.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3147036244016021082/posts/default/4019214030236538292'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3147036244016021082/posts/default/4019214030236538292'/><link rel='alternate' type='text/html' href='http://c9s.blogspot.com/2014/05/php-php-mailing-list.html' title='重構 PHP 引擎並大幅改善效能 - PHP Mailing List'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/05514217676033260267</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3147036244016021082.post-5246781512757456685</id><published>2014-04-25T10:29:00.002+08:00</published><updated>2014-04-28T17:41:57.530+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Mac OS"/><category scheme="http://www.blogger.com/atom/ns#" term="SSD"/><title type='text'>Mac OS X 之 SSD 保養 - 適用 Macbook Air, Macbook Pro 等</title><content type='html'>SSD 擁有相當優異的高效能讀寫效率，但大家都知道 SSD 以 2012 年以前的技術來說，&lt;a href=&quot;http://www.mobile01.com/topicdetail.php?f=481&amp;amp;t=3564815&amp;amp;p=1&quot;&gt;若經常使用，壽命通常大約落在 1-2 年&lt;/a&gt;，不如機械式硬碟長。筆者一顆去年買的 Kingston 128GB，差不多 1 年又兩個月就突然宣告掛點，也因此，了解如何保養您的 SSD 是非常重要的一件事情。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Mac OS X 在背後偷偷幫你做的事情:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
1. Spotlight 索引&lt;/h3&gt;
&lt;br /&gt;
就是你右上角點放大鏡時，會出現的東西，我相信有很多人幾乎都不用這個功能 (我認識的人不是沒在用就是不知道有這個功能)，但這個功能預設是開啟的。&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://3.bp.blogspot.com/-YKnDlnVK-EU/U1nAaWMKRVI/AAAAAAAALZE/N5MSncsUtfY/s1600/Screenshot+2014-04-25+09.54.22.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;http://3.bp.blogspot.com/-YKnDlnVK-EU/U1nAaWMKRVI/AAAAAAAALZE/N5MSncsUtfY/s1600/Screenshot+2014-04-25+09.54.22.png&quot; height=&quot;245&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
雖然你沒用到，但這程式有時候會不停的在背景大量讀取檔案，有時需要電腦做一些較重的工作時，整個系統會變得很吃力。&lt;br /&gt;
&lt;br /&gt;
如果在終端機內輸入 fs_usage ，你會發現有時硬碟大量的讀寫都是來自 mdworker，而這個 mdworker 就是 Spotlight 索引的背景程式。 他會怎麼跑? 你有多少檔案，他就跑多少檔案，不管那些檔案你到底有沒有用到，他都會收納起來放在這個搜尋索引內。&lt;br /&gt;
&lt;br /&gt;
有幾種調校方式:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* 關掉 Spotlight: 如果你完全不使用 Spotlight，則可以考慮把 Spotlight 完全關閉，而 Spotlight 基本上是沒辦法從圖形介面去關閉的，所以你必須先打開你的&quot;終端機&quot;，輸入一些指令:&lt;br /&gt;
&lt;br /&gt;
&lt;code&gt;$ sudo mdutil -i off /&lt;/code&gt;&lt;br /&gt;
&lt;br /&gt;
這樣可以關閉掉整個本機磁碟的索引。要關掉所有磁碟的索引？&lt;br /&gt;
&lt;br /&gt;
&lt;code&gt;$ sudo mdutil -i off -a&lt;/code&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* 關掉平常不搜尋的檔案類型: 點開放大鏡，最下方有一個 Spotlight 設定，點開之後，把不必要的類型都關掉:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://3.bp.blogspot.com/-JQc09aSFXJA/U1nBmMshCxI/AAAAAAAALZQ/P7AKOn10M3Y/s1600/Screenshot+2014-04-25+09.59.21.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;http://3.bp.blogspot.com/-JQc09aSFXJA/U1nBmMshCxI/AAAAAAAALZQ/P7AKOn10M3Y/s1600/Screenshot+2014-04-25+09.59.21.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* 忽略有零碎小檔的目錄:&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://4.bp.blogspot.com/-3TgWCgdiV5g/U1nBma-eaWI/AAAAAAAALZU/5LS8dRuaxSg/s1600/Screenshot+2014-04-25+09.59.24.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;http://4.bp.blogspot.com/-3TgWCgdiV5g/U1nBma-eaWI/AAAAAAAALZU/5LS8dRuaxSg/s1600/Screenshot+2014-04-25+09.59.24.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;h3&gt;
2.&amp;nbsp;關閉 Time Machine 的本機備份模式&lt;/h3&gt;
&lt;br /&gt;
Time Machine 的備份方式是這樣的，首先他每個小時會產生一個備份點 (Checkpoint)，每 24 個小時，留下一個備份點，過一個月，就留下當月每天的備份點，每個月都留下每週的備份點。當硬碟空間不夠的時候，Time Machine 就會開始問你要不要清除一些太舊的備份點，來獲取更多空間。&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;而從 Mac OS Lion 版本之後，Mac OS 的 Time Machine 會在你沒有外接硬碟時，在本機建立一整套備份。 (如果你有開 Time Machine 的話)&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
平常我們都是將資料備份到外接硬碟，外出時也不會帶整個外接硬碟出門，沒接上外接硬碟，Time Machine 就會開始讀取你整顆硬碟的內容，全部備份到 /Volumn/MobileBackups 這個路徑底下。&lt;br /&gt;
&lt;br /&gt;
平常 SSD 空間就很不夠用了，這時候居然還來 Local Backup 全部複製一份寫進 SSD?&lt;br /&gt;
&lt;br /&gt;
剛剛有講到 mdutil 是 Spotlight，要處理 Time Machine 相關設定，把本機備份關掉，可以透過 tmutil:&lt;br /&gt;
&lt;br /&gt;
&lt;code&gt;$ sudo tmutil disablelocal&lt;/code&gt;&lt;br /&gt;
&lt;br /&gt;
這樣就可以把本機備份關掉了。&lt;br /&gt;
&lt;br /&gt;
其他 tmutil 相關使用說明，可以用下列指令查詢:&lt;br /&gt;
&lt;br /&gt;
&lt;code&gt;$ man tmutil&lt;/code&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
另外，如果你在系統偏好設定中變更了 Time Machine 的備份硬碟，或是關閉又打開 了 Time Machine，Time Machine 的本機備份模式就會自動開啟，你必須再執行一次上面的指令才能再次關閉本機備份。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
3. 設定 noatime 掛載&lt;/h3&gt;
&lt;br /&gt;
首先要先講 noatime，什麼是 noatime？atime 就是指所謂檔案存取時間 (File Access Time)，你平日在開啟檔案時，就會更新這個 access time，每更新一次 access time，硬碟就必須讀寫，減少硬碟的壽命。&lt;br /&gt;
&lt;br /&gt;
新版的 Mountain Lion 會在 All Files 分頁或是 Spotlight 內列出所有最近使用的檔案，並且利用這個 access time 做排序。&lt;br /&gt;
&lt;br /&gt;
如果你不需要這個功能，可使用下列步驟來停止使用 Access Time:&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code&gt;$ sudo -i&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code&gt;$&amp;nbsp;cat &amp;gt; /Library/LaunchDaemons/com.disk.noatime.plist&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
接著貼上:&lt;/div&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;
&lt;pre&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&amp;gt;
&amp;lt;!DOCTYPE plist PUBLIC &quot;-//Apple//DTD PLIST 1.0//EN&quot;
&quot;http://www.apple.com/DTDs/PropertyList-1.0.dtd&quot;&amp;gt;
&amp;lt;plist version=&quot;1.0&quot;&amp;gt;
&amp;lt;dict&amp;gt;
        &amp;lt;key&amp;gt;Label&amp;lt;/key&amp;gt;
        &amp;lt;string&amp;gt;com.disk.noatime&amp;lt;/string&amp;gt;
        &amp;lt;key&amp;gt;ProgramArguments&amp;lt;/key&amp;gt;
        &amp;lt;array&amp;gt;
                &amp;lt;string&amp;gt;mount&amp;lt;/string&amp;gt;
                &amp;lt;string&amp;gt;-vuwo&amp;lt;/string&amp;gt;
                &amp;lt;string&amp;gt;noatime&amp;lt;/string&amp;gt;
                &amp;lt;string&amp;gt;/&amp;lt;/string&amp;gt;
        &amp;lt;/array&amp;gt;
        &amp;lt;key&amp;gt;RunAtLoad&amp;lt;/key&amp;gt;
        &amp;lt;true/&amp;gt;
&amp;lt;/dict&amp;gt;
&amp;lt;/plist&amp;gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
4.&amp;nbsp;變更睡眠時資料存放的位置&lt;/h3&gt;
&lt;br /&gt;
&lt;br /&gt;
當你闔上螢幕時，Mac OS X 會進入到睡眠模式，此時會將目前在執行中的資料都暫時存放在記憶體中，若快沒電時，則將所有在記憶體內的資料寫入到硬碟，防止資料流失。&lt;br /&gt;
&lt;br /&gt;
若你有 4GB 的記憶體，一次睡眠，有可能會把 4GB 全數寫入硬碟，開機時再全部讀回。&lt;br /&gt;
&lt;br /&gt;
如果你不在乎執行中資料流失的話，可把設定改成睡眠時 &quot;只存放在記憶體中&quot;&lt;br /&gt;
&lt;br /&gt;
可透過下列指令設定:&lt;br /&gt;
&lt;br /&gt;
&lt;code&gt;$ sudo pmset -a hibernatemode 0&lt;/code&gt;&lt;br /&gt;
&lt;br /&gt;
其中 &quot;-a&quot; 代表不論是電池模式 (-b)、電源模式 (-c)、UPS 模式 (-u)，皆使用此設定。&lt;br /&gt;
&lt;br /&gt;
查看目前模式可輸入:&lt;br /&gt;
&lt;br /&gt;
&lt;code&gt;$ sudo pmset -g&lt;/code&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
5. 關閉不必要的 Chrome 分頁&lt;/h3&gt;
你若打開 iotop 查看 I/O 的讀寫狀況，你會發現 Google Chrome 在背景也做了不少 I/O:&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;2014 Apr 25 11:16:49,  load: 2.21,  disk_r:    720 KB,  disk_w:   1356 KB

  UID    PID   PPID CMD              DEVICE  MAJ MIN D            BYTES
    0     24      1 cfprefsd         ??        1   2 W             4096
  501   8797    383 Google Chrome H  ??        1   2 W             4096
  501   8798    383 Google Chrome H  ??        1   2 W             4096
  501   8799    383 Google Chrome H  ??        1   2 W             4096
  501   4948    209 iTerm            ??        1   2 W            20480
    0    157      1 mds_stores       ??        1   2 R            57344
  501   8797    383 Google Chrome H  ??        1   2 R           126976
  501    221    209 SystemUIServer   ??        1   2 W           200704
  501    383    209 Google Chrome    ??        1   2 R           557056
  501    381    209 iPhoto           ??        1   2 W           585728
  501    383    209 Google Chrome    ??        1   2 W           585728&lt;/pre&gt;
&lt;br /&gt;
為什麼呢？ 因為 Google Chrome 為了高效的執行效率，所有運算的結果都會儲存成快取資料，執行時因此消耗大量記憶體，當分頁越來越多，Google Chrome 就會開始把沒有調閱的分頁暫時儲存到硬碟裡，等到切換過去時，再將結果全部讀出來。&lt;br /&gt;
&lt;br /&gt;
當然，這只是其中一項原因，以下是幾個 Chrome 相關的 Bug Report 可參考看看:&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://code.google.com/p/chromium/issues/detail?id=176727&quot;&gt;Heavy I/O generated by chrome during inactivity - what happen/some craches?&amp;nbsp;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://code.google.com/p/chromium/issues/detail?id=52663&quot;&gt;frequent small disk I/O&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
5. 盡量不要讓記憶體呈現滿載的狀況&lt;/h3&gt;
&lt;div&gt;
現代的操作系統大多會在記憶體不夠使用的時候，將記憶體內未使用到的內容搬動到磁碟裡，等到要使用時，再把另外一份空間寫入 Disk 挪空間出來放要使用的程式。&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;h3&gt;
6. 操作大檔或備份請愛用外接硬碟&lt;/h3&gt;
&lt;/div&gt;
&lt;div&gt;
覺得一般外接硬碟太慢嗎？用 Time Capsule 備份又不給力一兩年就壞掉嗎？狂推 &lt;a href=&quot;http://24h.pchome.com.tw/prod/DRAA6H-A900524XO&quot;&gt;&quot;WD My Book Thunderbolt Duo 6TB(3TBx2) 3.5吋雙硬碟儲存系統&quot;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://3.bp.blogspot.com/-jXqrKPgY2go/U1nks1czZDI/AAAAAAAALZo/ngopdezkaig/s1600/DRAA6H-A900524XO000_533d0ec506fd8.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;http://3.bp.blogspot.com/-jXqrKPgY2go/U1nks1czZDI/AAAAAAAALZo/ngopdezkaig/s1600/DRAA6H-A900524XO000_533d0ec506fd8.jpg&quot; height=&quot;320&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
透過 Thunderbolt 讓你效能不輸 SSD 又能有極高的穩定性&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
目前來講，WD,&amp;nbsp;Hitachi 是可靠度最高的兩個硬碟廠牌，backblaze 發佈了一篇文章講述過去 backblaze 使用了兩萬七千顆硬碟壽命之統計記錄:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://images.techhive.com/images/article/2014/01/backblaze-annual-hdd-failure-rate-100226259-medium.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;http://images.techhive.com/images/article/2014/01/backblaze-annual-hdd-failure-rate-100226259-medium.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
可參考: &lt;a href=&quot;http://blog.backblaze.com/2014/01/21/what-hard-drive-should-i-buy/&quot;&gt;http://blog.backblaze.com/2014/01/21/what-hard-drive-should-i-buy/&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
這邊說明一下為什麼寧可用 WD Thunderbolt Duo 也不要用&amp;nbsp;AirPort Time Capsule，雖然 Time Capsule 可以用 Wifi 進行 Time Machine 備份，但你若自己去 Google 一下 &quot;AirPort Time Capsule&quot; &quot;無法使用&quot; 或 &quot;壞掉&quot; 你會發現大部分的消費者用了一兩年 Time Capsule 就壞掉了，因為 Time Capsule 為了外型漂亮，散熱做得並不好，一旦長時間複製檔案，很容易就造成過熱的狀況。&lt;br /&gt;
&lt;br /&gt;
而且，看上方硬碟 Failure Rate 你覺得還有什麼牌子能贏過 HITACHI 或 WD 的穩定度嗎？XD&lt;br /&gt;
&lt;br /&gt;
相同的價錢，明明就可以買到更高傳輸效能的 Thunderbolt 儲存設備，且既然都要備份了，備份講究的就是穩定度，還是選個比較靠譜的 WD 比較好。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;h3&gt;
7. 透過 iotop 觀測&lt;/h3&gt;
&lt;/div&gt;
&lt;div&gt;
每個人使用電腦的習慣都不同，開發的環境也都不同，最後一道防線就是多利用 fs_usage 與 iotop 等工具來觀察作業系統背景在跑些什麼程式執行了大量了 I/O ，如果你發現了某程式進行大量 I/O 你又很少用的話，就盡可能少開。&lt;br /&gt;
&lt;br /&gt;
一般來說， fs_usage 倒出來的內容太多，很難從幾百幾千行的內容得到一些結論，可利用 iotop 來取得一些 sample 資料:&lt;br /&gt;
&lt;br /&gt;
&lt;code&gt;$ iotop -C 5 12&lt;/code&gt;&lt;br /&gt;
&lt;br /&gt;
上面的指令每五秒印出結果，每個循環取得 12 個樣本資料，可印出如下:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;pre&gt;Tracing... Please wait.
2014 Apr 25 19:35:38,  load: 2.06,  disk_r:    184 KB,  disk_w:    260 KB

  UID    PID   PPID CMD              DEVICE  MAJ MIN D            BYTES
    0     24      1 cfprefsd         ??        1   2 W             4096
  501    216    209 cfprefsd         ??        1   2 W             4096
    0     20      1 syslogd          ??        1   2 R             8192
  501    241    209 CalendarAgent    ??        1   2 W             8192
  501  12535    209 Mail             ??        1   2 R            20480
  501    241    209 CalendarAgent    ??        1   2 R            49152
  501  16062      1 com.apple.inter  ??        1   2 W            61440
  501  16062      1 com.apple.inter  ??        1   2 R           110592
  501    221    209 SystemUIServer   ??        1   2 W           188416&lt;/pre&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
上面的結果來看，第一行 &quot;disk_r&quot; 是總讀取量, &quot;disk_w&quot; 則是總寫入量&lt;br /&gt;
&lt;br /&gt;
第二行 &quot;PID&quot; 是指該程序的 Process ID，&quot;D&quot; 欄位中 &quot;W&quot; 是寫入, &quot;R&quot; 是 讀取，&quot;BYTES&quot; 欄位則顯示讀出或寫入的位元組數量&lt;br /&gt;
&lt;br /&gt;
以此類推，你可以很容易的找出消耗你 SSD 壽命的罪魁禍首。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
8. 透過 Activity Monitor 觀測&lt;/h3&gt;
Mac OS 內建的 Activity Monitor 其實是一個非常好用的工具，除了拿來看 Disk IO 的狀況，還可以觀測那個 App 消耗最多計算能源 (Computation Power):&lt;br /&gt;
&lt;br /&gt;
點擊 Bytes Written 就可以依照順序排出 I/O 操作最多的應用程式。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://2.bp.blogspot.com/-vMrtfBaXlGc/U14hXSRsJyI/AAAAAAAALaQ/r0e4G7u0rLI/s1600/Screen+Shot+2014-04-28+at+17.37.03.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;http://2.bp.blogspot.com/-vMrtfBaXlGc/U14hXSRsJyI/AAAAAAAALaQ/r0e4G7u0rLI/s1600/Screen+Shot+2014-04-28+at+17.37.03.png&quot; height=&quot;476&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
以上圖我的狀況來說，因為開機後進行了一些大量檔案複製操作，因此可以忽略 Finder, kernel_task 等的統計數據。 mds_stores 則表示我的 Spotlight 在更新搜尋索引的時候所寫入的容量，再來就是 Google Chrome 的寫入狀況，目前使用狀況大致在 10-12 個分頁左右。&lt;br /&gt;
&lt;br /&gt;
當然每個人操作狀況不同，結果也會不同，就看大家怎麼去優化系統了。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://c9s.blogspot.com/feeds/5246781512757456685/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://c9s.blogspot.com/2014/04/mac-os-x-ssd-macbook-air-macbook-pro.html#comment-form' title='1 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3147036244016021082/posts/default/5246781512757456685'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3147036244016021082/posts/default/5246781512757456685'/><link rel='alternate' type='text/html' href='http://c9s.blogspot.com/2014/04/mac-os-x-ssd-macbook-air-macbook-pro.html' title='Mac OS X 之 SSD 保養 - 適用 Macbook Air, Macbook Pro 等'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/05514217676033260267</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/-YKnDlnVK-EU/U1nAaWMKRVI/AAAAAAAALZE/N5MSncsUtfY/s72-c/Screenshot+2014-04-25+09.54.22.png" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3147036244016021082.post-273647330585921028</id><published>2014-01-20T17:06:00.001+08:00</published><updated>2014-01-20T17:11:49.172+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Php"/><category scheme="http://www.blogger.com/atom/ns#" term="PHP Extension"/><category scheme="http://www.blogger.com/atom/ns#" term="Zend VM"/><title type='text'>Zend VM: zend object, persistent zval 以及 persistent hash table</title><content type='html'>趁現在還有印象，筆記一下關於 Zend VM 內部的 persistency mechanism:&lt;br /&gt;
&lt;br /&gt;
1. &lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;ALLOC_INIT_ZVAL&lt;/span&gt; 基本上就是 &lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;ALLOC_ZVAL&lt;/span&gt; 加上 &lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;INIT_ZVAL&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
2. &lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;MAKE_STD_ZVAL&lt;/span&gt; 是 &lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;ALLOC_ZVAL&lt;/span&gt; 加上 &lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;INIT_PZVAL &lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
3. &lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;INIT_PZVAL&lt;/span&gt; 跟 &lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;INIT_ZVAL&lt;/span&gt; 的差異是 &lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;PZVAL&lt;/span&gt; 會將 &lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;refcount__gc&lt;/span&gt; 設置為 1 而 INIT_ZVAL 基本上只是將所有的欄位設置為 0。 所以 &lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;ALLOC_INIT_ZVAL&lt;/span&gt; 出來的 zval 如果沒有處理好，會被 gc 清掉。&lt;br /&gt;
&lt;br /&gt;
4. zend object 不支援 persistent，其中一部分原因在於 object 基本上分為 &lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;zend_object&lt;/span&gt; 以及 &lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;zend_object_value&lt;/span&gt;, &lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;zend_object&lt;/span&gt; 是 persistent，但 &lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;zend_object_value&lt;/span&gt; 不是，且 object 本身的 properties 跟 handlers 都是使用 emalloc 申請來的，這些記憶體會在 request 結束的時候一起 free 掉。&lt;br /&gt;
&lt;br /&gt;
5. HashTable 結構可以 allocate 成 persistent memory，其中幾例是 &lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;EG(persistent_list)&lt;/span&gt; 或 &lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;EG(symbol_table)&lt;/span&gt;. 基本上需先使用 pemalloc allocate persistent memory 再使用 zend_hash_init 初始化 HashTable 結構變數，其中最後一項參數 persistent 必須為 1，則 allocate bucket 時，bucket 本身的記憶體才會是 persistent。&lt;br /&gt;
&lt;br /&gt;
6. &lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;zend_hash_copy&lt;/span&gt; 基本上是直接對 buckets 做拷貝的動作，所以 zval* 實際上還是同一個，只是在 &lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;copy_ctor_func&lt;/span&gt; 你可以透過 &lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;Z_ADDREF_P&lt;/span&gt; 來增加 reference counting。&lt;br /&gt;
&lt;br /&gt;
7. 要對 &lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;HashTable&lt;/span&gt; 完全拷貝，只能另外自己寫 recursive copy function，對於 value 內的 zval* 得另外 allocate zval* 出來，這樣在 &lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;persistent_list&lt;/span&gt; 內才不會被 request 結束時的 clean up handler 清除掉。&lt;br /&gt;
&lt;br /&gt;
8. 也就是說 object 沒有辦法 persistent 保留在程序中，在 APC 的作法，則是針對 object 去做 serialize。 沒錯就是那個 serialize 函數。&lt;br /&gt;
&lt;br /&gt;
9. zval 基本上都是 copy on write，如果在 extension 內要明確的複製 zval 結構到新的記憶體空間，則必須使用 &lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;SEPARATE_ZVAL&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
10. 只要是 emalloc 來的記憶體，不管 refcount 是否大於 0，&quot;幾乎&quot; 都會在 &lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;RSHUTDOWN&lt;/span&gt; 時被清除掉。</content><link rel='replies' type='application/atom+xml' href='http://c9s.blogspot.com/feeds/273647330585921028/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://c9s.blogspot.com/2014/01/zend-vm-zend-object-persistent-zval.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3147036244016021082/posts/default/273647330585921028'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3147036244016021082/posts/default/273647330585921028'/><link rel='alternate' type='text/html' href='http://c9s.blogspot.com/2014/01/zend-vm-zend-object-persistent-zval.html' title='Zend VM: zend object, persistent zval 以及 persistent hash table'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/05514217676033260267</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3147036244016021082.post-5520072715699707674</id><published>2014-01-07T10:40:00.001+08:00</published><updated>2014-01-07T11:26:17.823+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Php"/><category scheme="http://www.blogger.com/atom/ns#" term="Router"/><category scheme="http://www.blogger.com/atom/ns#" term="Symfony"/><category scheme="http://www.blogger.com/atom/ns#" term="Zend"/><title type='text'>Pux - 以新的概念重新設計 PHP Router</title><content type='html'>時下開源的 PHP Router 如 Symfony/Routing 或 Zend\Mvc\Router 多半是以一個 Persistent &amp;nbsp;HTTP server 的角度來設計，然而一般 PHP 是通過&amp;nbsp;CGI 或 Apache 來執行，這樣的設計會讓您的 PHP 應用程式在執行時間跟編譯時間消耗太多效能，有過多的方法呼叫、類別載入、物件建置等等。&lt;br /&gt;
&lt;br /&gt;
在這些舊有的模式下，每一個新的 HTTP 請求進來，PHP 就必須重新把每個模組的路徑載入，且透過多個 method call 把路徑定義到一個 PHP Array，再使用 PHP 去對每個路徑做比對。&lt;br /&gt;
&lt;br /&gt;
有些 Router 的設計甚至做了更多的預先處理，譬如: Symfony/Routing 得利用 RouteCompiler 把路徑編譯成 PCRE Pattern, Symfony/Routing 甚至強迫每個 Route 都一定得使用 PCRE 來比對。&lt;br /&gt;
&lt;br /&gt;
雖然在小型應用程式還過得去，但在稍微大一點的 PHP 應用程式，Controller 與 Route Path 動扎幾十幾百個，整體消耗下來的多餘計算其實相當可觀。&lt;br /&gt;
&lt;br /&gt;
這些重複的預先處理其實是不必要的，如果能夠避免預先處理或者函數呼叫，就可以提昇整體效能。&lt;br /&gt;
&lt;br /&gt;
然而，直接定義 Route 成 PHP Array 雖然可以增加效能，但反而卻增加了開發成本。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
因此，針對這些問題，筆者在去年底跨年夜，重新設計了一個新的 PHP Router。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Pux (&lt;a href=&quot;http://c9s.github.io/Pux/&quot;&gt;http://c9s.github.io/Pux/&lt;/a&gt;)&amp;nbsp;是一個以效能為導向所設計的 PHP Router，針對 PHP 本身在 CGI 或 Apache 環境上的執行時間 (Run-time) 特性，以新的方式設計的 PHP Router。&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Pux 簡化了每個路徑的資料結構，並自動將路徑類型分為兩種類型，一種是需透過 PCRE 正規表示來比對的路徑，另外一種則是純字串的靜態路徑。&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
會這麼做的原因，是因為 PCRE 正規表示的比對相對比純字串比對慢，甚至靜態路徑可以直接透過 Hash 表來查找。&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
此外 Pux 針對在 Production 環境上效能重點，支持了使用 C 語言開發的 PHP Extension，只要安裝這個 Extension，就可以避免 PHP Class 重新載入，路徑比對的速度也會更快，可得到更高的執行效能。&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
使用&lt;/h3&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;
&lt;div&gt;
使用 Pux，您可在任何一個 framework 內建置您的 Route 定義檔，在檔案最尾端回傳 Mux 物件&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background-color: #f8f8f8; border-bottom-left-radius: 5px; border-bottom-right-radius: 5px; border-top-left-radius: 5px; border-top-right-radius: 5px; border: 1px solid rgb(229, 229, 229); color: #333333; font-family: Monaco, &#39;Bitstream Vera Sans Mono&#39;, &#39;Lucida Console&#39;, Terminal; font-size: 12px; margin-bottom: 20px; overflow-x: auto; padding: 8px 15px;&quot;&gt;&lt;span class=&quot;o&quot; style=&quot;font-weight: bold;&quot;&gt;&lt;span class=&quot;c1&quot; style=&quot;color: #999988; font-style: italic;&quot;&gt;// load your composer autoload if it&#39;s needed&lt;/span&gt;
&lt;span class=&quot;c1&quot; style=&quot;color: #999988; font-style: italic;&quot;&gt;// require &#39;../vendor/autoload.php&#39;;&lt;/span&gt;
&lt;span class=&quot;k&quot; style=&quot;font-weight: bold;&quot;&gt;use&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Pux\Mux&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;nv&quot; style=&quot;color: teal;&quot;&gt;$mux&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;font-weight: bold;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot; style=&quot;font-weight: bold;&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Mux&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;nv&quot; style=&quot;color: teal;&quot;&gt;$mux&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;font-weight: bold;&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;color: teal;&quot;&gt;get&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot; style=&quot;color: #dd1144;&quot;&gt;&#39;/hello&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s1&quot; style=&quot;color: #dd1144;&quot;&gt;&#39;HelloController&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;s1&quot; style=&quot;color: #dd1144;&quot;&gt;&#39;helloAction&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]);&lt;/span&gt;
&lt;span class=&quot;k&quot; style=&quot;font-weight: bold;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;nv&quot; style=&quot;color: teal;&quot;&gt;$mux&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
接著使用 Pux 提供的命令列工具將定義檔編譯成 PHP Array:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;
&lt;pre style=&quot;background-color: #f8f8f8; border-bottom-left-radius: 5px; border-bottom-right-radius: 5px; border-top-left-radius: 5px; border-top-right-radius: 5px; border: 1px solid rgb(229, 229, 229); color: #333333; font-family: Monaco, &#39;Bitstream Vera Sans Mono&#39;, &#39;Lucida Console&#39;, Terminal; font-size: 12px; margin-bottom: 20px; overflow-x: auto; padding: 8px 15px;&quot;&gt;&lt;code style=&quot;font-family: Monaco, &#39;Bitstream Vera Sans Mono&#39;, &#39;Lucida Console&#39;, Terminal;&quot;&gt;pux compile -o hello_mux.php hello_routes.php&lt;/code&gt;&lt;/pre&gt;
接著在您的應用程式內，只要寫一行 require 引入這個檔案就可以直接使用 Mux 做路徑比對的動作:&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background-color: #f8f8f8; border-bottom-left-radius: 5px; border-bottom-right-radius: 5px; border-top-left-radius: 5px; border-top-right-radius: 5px; border: 1px solid rgb(229, 229, 229); color: #333333; font-family: Monaco, &#39;Bitstream Vera Sans Mono&#39;, &#39;Lucida Console&#39;, Terminal; font-size: 12px; margin-bottom: 20px; overflow-x: auto; padding: 8px 15px;&quot;&gt;&lt;span class=&quot;o&quot; style=&quot;font-weight: bold;&quot;&gt;&lt;span class=&quot;nv&quot; style=&quot;color: teal;&quot;&gt;$mux&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;font-weight: bold;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot; style=&quot;font-weight: bold;&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;s2&quot; style=&quot;color: #dd1144;&quot;&gt;&quot;hello_mux.php&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;nv&quot; style=&quot;color: teal;&quot;&gt;$route&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;font-weight: bold;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nv&quot; style=&quot;color: teal;&quot;&gt;$mux&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;font-weight: bold;&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;color: teal;&quot;&gt;dispatch&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot; style=&quot;color: #dd1144;&quot;&gt;&#39;/hello&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;br /&gt;
&lt;h3&gt;
效能&lt;/h3&gt;
&lt;br /&gt;
以重新設計過的 Pux Router (Phux 舊名)，在 iMac 2012 Mid 機器上 (Rough Benchmark) 與 Symfony/Routing 的效能比較，以下是參考數據:&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://raw.github.com/c9s/Pux/master/benchmarks/reqs.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;300&quot; src=&quot;https://raw.github.com/c9s/Pux/master/benchmarks/reqs.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div style=&quot;margin-bottom: 20px;&quot;&gt;
&lt;br /&gt;
&lt;br /&gt;
反應時間的部份, Pux 純 PHP 版本平均需要 8-10ms 的反應時間，但 Symfony 最 Minimal 的載入至少需要 9ms 平均 30-40ms 左右&lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://raw.github.com/c9s/Pux/master/benchmarks/pux.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;300&quot; src=&quot;https://raw.github.com/c9s/Pux/master/benchmarks/pux.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Pux - Requests per second&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://raw.github.com/c9s/Pux/master/benchmarks/symfony-routing.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;300&quot; src=&quot;https://raw.github.com/c9s/Pux/master/benchmarks/symfony-routing.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Symfony/Routing - Requests per second&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;br /&gt;
測試案例的程式碼可在 &lt;a href=&quot;http://github.com/c9s/router-benchmark&quot;&gt;router-benchmark&lt;/a&gt; 找到，兩者的測試案例都相當簡單，只有一個 /hello route ，並且純粹就 dispatch 的速度來做比較。&lt;br /&gt;
&lt;br /&gt;
註: Symfony/Routing 的測試案例不包含 Controller, Symfony, UrlGenerator, Apache2 Rule Dumper。&lt;br /&gt;
&lt;br /&gt;
Testing with route dispatch only. (no controller)&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #777777; font-family: Lato, Helvetica Neue, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 21px;&quot;&gt;Hardware:&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;iMac Mid 2011&lt;/li&gt;
&lt;li&gt;Processor 2.5 GHz Intel Core i5&lt;/li&gt;
&lt;li&gt;Memory 12 GB 1333 MHz DDR3&lt;/li&gt;
&lt;li&gt;Software OS X 10.9.1 (13B42)&lt;/li&gt;
&lt;/ul&gt;
&lt;div style=&quot;color: #777777; font-family: Lato, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 21px; margin-bottom: 20px;&quot;&gt;
Environment:&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;Apache 2.2 + prefork worker&lt;/li&gt;
&lt;li&gt;PHP 5.5.6 + opcache&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://c9s.blogspot.com/feeds/5520072715699707674/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://c9s.blogspot.com/2014/01/pux-php-router.html#comment-form' title='4 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3147036244016021082/posts/default/5520072715699707674'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3147036244016021082/posts/default/5520072715699707674'/><link rel='alternate' type='text/html' href='http://c9s.blogspot.com/2014/01/pux-php-router.html' title='Pux - 以新的概念重新設計 PHP Router'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/05514217676033260267</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry></feed>