tag:blogger.com,1999:blog-34682293706861385442024-03-15T02:03:36.164+08:00Fast IterationArrakeenhttp://www.blogger.com/profile/05514217676033260267noreply@blogger.comBlogger9125tag:blogger.com,1999:blog-3468229370686138544.post-60042259904559841392014-07-05T01:12:00.002+08:002014-07-05T01:12:53.507+08:00CLIFramework - A command-line application framework for PHP and the difference between symfony/consoleIf you're using <a href="http://symfony.com/doc/current/components/console/introduction.html">Symfony/Console</a> component as your command-line application base library, you should already know the API design of <a href="http://symfony.com/doc/current/components/console/introduction.html">Symfony/Console</a> is pretty cumbersome, you need to write more lines of code to define an argument or an option.<br />
<br />
Thus, you might want to know a simpler / powerful comand-line application framework, <a href="https://github.com/c9s/CLIFramework">CLIFramework</a> is designed for simplicity / extensibility.<br />
<br />
The main difference between CLIFramework and <a href="http://symfony.com/doc/current/components/console/introduction.html">Symfony/Console</a> is that:<br />
<br />
1. Fluent-style for command argument definition and option definition.<br />
<br />
2. Option spec with concise expression.<br />
<br />
3. Powerful ZSH completion generator. (With Symfony/Console, you have to write zsh completion script for each application.. "by hands!")<br />
<br />
The zsh completion generator can convert your hierarchical commands / options into a zsh completion script.<br />
<br />
Let's see the power of zsh completion generator, the following completion demo is used in phpbrew. The completion script is auto-generated by CLIFramework:<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://imgur.com/sU3mrDe.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://imgur.com/sU3mrDe.gif" height="255" width="640" /></a></div>
<br />
<br />
<br />Arrakeenhttp://www.blogger.com/profile/05514217676033260267noreply@blogger.com0tag:blogger.com,1999:blog-3468229370686138544.post-28788194480179176532014-06-10T18:16:00.001+08:002014-06-12T10:03:34.100+08:00Perl URL Router Benchmarks - The URL Router for C100KTo improve the overhead of URL routing, I developed a tiny URL routing library in C - <a href="https://github.com/c9s/r3">R3</a>, which is designed for high performance and low memory usage.<br />
<br />
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's pretty fast for matching routes.<br />
<br />
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.<br />
<br />
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.<br />
<br />
For those simple regular expression patterns, R3 compiles the regular expressions into opcodes to enhance the comparison speed and it's twice faster than using PCRE library to match the path with the patterns.<br />
<br />
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.<br />
<br />
<a href="http://c9s.github.io/r3/bench.html">Here is the continuous benchmark result of R3 itself</a>, The C version R3 can dispatch over 11 million plain string paths per second.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjdHdnx0QylMCvirxeA7nOtUDsuzJWQ8H-xstpvmh3FHxwWJqD037jC-nskOWA8A5Ugg1MZKlbl8OLMwwRiIcGm_vAToY_gQo05WQdsIPvZ1C8FCTSBs5OhGKrALXsiPdwdzfFGjP3gSh5R/s1600/Screen+Shot+2014-06-10+at+20.57.30.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjdHdnx0QylMCvirxeA7nOtUDsuzJWQ8H-xstpvmh3FHxwWJqD037jC-nskOWA8A5Ugg1MZKlbl8OLMwwRiIcGm_vAToY_gQo05WQdsIPvZ1C8FCTSBs5OhGKrALXsiPdwdzfFGjP3gSh5R/s1600/Screen+Shot+2014-06-10+at+20.57.30.png" height="252" width="640" /></a></div>
<br />
A talented Perl hacker - <a href="https://github.com/CindyLinz">Cindy Wang</a> developed a CPAN module based on R3 library - <a href="https://metacpan.org/pod/Router::R3">Router::R3</a>, which has become the fastest routing module on CPAN. It's so fast that you just can't deny.<br />
<br />
The Perl version R3 (Router::R3) can dispatch nearly 1 million static paths per second while Journey (The Rails router) dispatches 9.9 thousand static paths per second. and it's 466% faster than the second fastest module (Router::Room) in static path dispatching, 751% faster in first character matching.<br />
<br />
We also used the routing path generator from the rails' pull request <a href="https://github.com/stevegraham/rails/pull/1">stevegraham/rails/pull/1</a> to benchmark the Perl URL routers on CPAN, including <a href="https://metacpan.org/pod/HTTP::Router">HTTP::Router</a>, <a href="https://metacpan.org/pod/Router::Simple">Router::Simple</a>, <a href="https://metacpan.org/pod/Router::Boom">Router::Boom</a> and <a href="https://metacpan.org/pod/Router::R3">Router::R3</a><br />
<br />
There are over 3 hundred generated routing paths in the benchmark script. we tested the "static path matching" with the route in the middle of the list, and also the first route matching, regular expression matching.<br />
<br />
Here comes the dispatching speed result:<br />
<br />
<div style="-webkit-text-stroke-width: 0px; background-color: white; color: black; font-family: 'Helvetica Neue', 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;">
<div class="syntaxhighlighter nogutter highlight pl" id="highlighter_563364" style="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;">
<table border="0" cellpadding="0" cellspacing="0" style="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, 'Bitstream Vera Sans Mono', 'Courier New', 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;"><tbody style="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, 'Bitstream Vera Sans Mono', 'Courier New', 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;">
<tr style="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, 'Bitstream Vera Sans Mono', 'Courier New', 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;"><td class="code" style="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, 'Bitstream Vera Sans Mono', 'Courier New', 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;"><div class="container" style="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, 'Bitstream Vera Sans Mono', 'Courier New', 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;">
<div class="line number1 index0 alt2" style="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, 'Bitstream Vera Sans Mono', 'Courier New', 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;">
<code class="pl plain" style="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, 'Bitstream Vera Sans Mono', 'Courier New', 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;">Benchmarking </code><code class="pl string" style="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, 'Bitstream Vera Sans Mono', 'Courier New', 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;">'plain string matching'</code> <code class="pl plain" style="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, 'Bitstream Vera Sans Mono', 'Courier New', 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;">by path </code><code class="pl string" style="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, 'Bitstream Vera Sans Mono', 'Courier New', 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;">'/corge/quux/bar'</code></div>
<div class="line number2 index1 alt1" style="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, 'Bitstream Vera Sans Mono', 'Courier New', 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;">
<code class="pl plain" style="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, 'Bitstream Vera Sans Mono', 'Courier New', 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;">===============================================================</code></div>
<div class="line number3 index2 alt2" style="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, 'Bitstream Vera Sans Mono', 'Courier New', 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;">
<code class="pl spaces" style="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, 'Bitstream Vera Sans Mono', 'Courier New', 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;"> </code><code class="pl plain" style="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, 'Bitstream Vera Sans Mono', 'Courier New', 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;">Rate HTTP::Router Router::Simple Router::Boom Router::R3</code></div>
<div class="line number4 index3 alt1" style="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, 'Bitstream Vera Sans Mono', 'Courier New', 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;">
<code class="pl plain" style="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, 'Bitstream Vera Sans Mono', 'Courier New', 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;">HTTP::Router 203/s -- -89% -100% -100%</code></div>
<div class="line number5 index4 alt2" style="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, 'Bitstream Vera Sans Mono', 'Courier New', 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;">
<code class="pl plain" style="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, 'Bitstream Vera Sans Mono', 'Courier New', 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;">Router::Simple 1782/s 779% -- -99% -100%</code></div>
<div class="line number6 index5 alt1" style="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, 'Bitstream Vera Sans Mono', 'Courier New', 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;">
<code class="pl plain" style="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, 'Bitstream Vera Sans Mono', 'Courier New', 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;">Router::Boom 168658/s 83094% 9365% -- -82%</code></div>
<div class="line number7 index6 alt2" style="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, 'Bitstream Vera Sans Mono', 'Courier New', 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;">
<code class="pl plain" style="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, 'Bitstream Vera Sans Mono', 'Courier New', 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;">Router::R3 954407/s 470684% 53461% 466% --</code></div>
<div class="line number8 index7 alt1" style="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, 'Bitstream Vera Sans Mono', 'Courier New', 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;">
</div>
<div class="line number9 index8 alt2" style="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, 'Bitstream Vera Sans Mono', 'Courier New', 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;">
<code class="pl plain" style="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, 'Bitstream Vera Sans Mono', 'Courier New', 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;">Benchmarking </code><code class="pl string" style="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, 'Bitstream Vera Sans Mono', 'Courier New', 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;">'regexp string matching'</code> <code class="pl plain" style="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, 'Bitstream Vera Sans Mono', 'Courier New', 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;">by path </code><code class="pl string" style="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, 'Bitstream Vera Sans Mono', 'Courier New', 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;">'/post/2012/03'</code></div>
<div class="line number10 index9 alt1" style="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, 'Bitstream Vera Sans Mono', 'Courier New', 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;">
<code class="pl plain" style="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, 'Bitstream Vera Sans Mono', 'Courier New', 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;">===============================================================</code></div>
<div class="line number11 index10 alt2" style="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, 'Bitstream Vera Sans Mono', 'Courier New', 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;">
<code class="pl spaces" style="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, 'Bitstream Vera Sans Mono', 'Courier New', 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;"> </code><code class="pl plain" style="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, 'Bitstream Vera Sans Mono', 'Courier New', 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;">Rate HTTP::Router Router::Simple Router::Boom Router::R3</code></div>
<div class="line number12 index11 alt1" style="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, 'Bitstream Vera Sans Mono', 'Courier New', 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;">
<code class="pl plain" style="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, 'Bitstream Vera Sans Mono', 'Courier New', 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;">HTTP::Router 1076/s -- -88% -99% -100%</code></div>
<div class="line number13 index12 alt2" style="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, 'Bitstream Vera Sans Mono', 'Courier New', 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;">
<code class="pl plain" style="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, 'Bitstream Vera Sans Mono', 'Courier New', 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;">Router::Simple 9309/s 765% -- -91% -97%</code></div>
<div class="line number14 index13 alt1" style="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, 'Bitstream Vera Sans Mono', 'Courier New', 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;">
<code class="pl plain" style="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, 'Bitstream Vera Sans Mono', 'Courier New', 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;">Router::Boom 104387/s 9602% 1021% -- -66%</code></div>
<div class="line number15 index14 alt2" style="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, 'Bitstream Vera Sans Mono', 'Courier New', 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;">
<code class="pl plain" style="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, 'Bitstream Vera Sans Mono', 'Courier New', 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;">Router::R3 306925/s 28426% 3197% 194% --</code></div>
<div class="line number16 index15 alt1" style="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, 'Bitstream Vera Sans Mono', 'Courier New', 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;">
</div>
<div class="line number17 index16 alt2" style="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, 'Bitstream Vera Sans Mono', 'Courier New', 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;">
<code class="pl plain" style="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, 'Bitstream Vera Sans Mono', 'Courier New', 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;">Benchmarking </code><code class="pl string" style="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, 'Bitstream Vera Sans Mono', 'Courier New', 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;">'first character matching'</code> <code class="pl plain" style="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, 'Bitstream Vera Sans Mono', 'Courier New', 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;">by path </code><code class="pl string" style="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, 'Bitstream Vera Sans Mono', 'Courier New', 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;">'/'</code></div>
<div class="line number18 index17 alt1" style="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, 'Bitstream Vera Sans Mono', 'Courier New', 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;">
<code class="pl plain" style="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, 'Bitstream Vera Sans Mono', 'Courier New', 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;">===============================================================</code></div>
<div class="line number19 index18 alt2" style="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, 'Bitstream Vera Sans Mono', 'Courier New', 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;">
<code class="pl spaces" style="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, 'Bitstream Vera Sans Mono', 'Courier New', 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;"> </code><code class="pl plain" style="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, 'Bitstream Vera Sans Mono', 'Courier New', 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;">Rate HTTP::Router Router::Simple Router::Boom Router::R3</code></div>
<div class="line number20 index19 alt1" style="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, 'Bitstream Vera Sans Mono', 'Courier New', 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;">
<code class="pl plain" style="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, 'Bitstream Vera Sans Mono', 'Courier New', 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;">HTTP::Router 3839/s -- -87% -98% -100%</code></div>
<div class="line number21 index20 alt2" style="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, 'Bitstream Vera Sans Mono', 'Courier New', 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;">
<code class="pl plain" style="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, 'Bitstream Vera Sans Mono', 'Courier New', 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;">Router::Simple 30545/s 696% -- -83% -98%</code></div>
<div class="line number22 index21 alt1" style="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, 'Bitstream Vera Sans Mono', 'Courier New', 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;">
<code class="pl plain" style="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, 'Bitstream Vera Sans Mono', 'Courier New', 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;">Router::Boom 180555/s 4603% 491% -- -88%</code></div>
<div class="line number23 index22 alt2" style="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, 'Bitstream Vera Sans Mono', 'Courier New', 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;">
<code class="pl plain" style="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, 'Bitstream Vera Sans Mono', 'Courier New', 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;">Router::R3 1535999/s 39910% 4929% 751% --</code></div>
</div>
</td></tr>
</tbody></table>
</div>
</div>
Arrakeenhttp://www.blogger.com/profile/05514217676033260267noreply@blogger.com0tag:blogger.com,1999:blog-3468229370686138544.post-83146159172994154292013-03-20T16:08:00.000+08:002013-03-20T16:11:31.655+08:00An Efficient Way Of Developing PHP Extension<span style="font-weight: normal;">Many people think developing PHP extension is really hard and too complex for them, so they rarely consider developing PHP extensions by themselves</span>.<br />
<br />
Here we want to show you an efficient, easier way of developing PHP extension that might make you reconsider about it. :-)<br />
<h3>
Creating Extension Skeleton</h3>
To make a basic extension works, you need 3 files to build your extension.<br />
<ul>
<li>config.m4</li>
<li>your_ext.c</li>
<li>your_ext.h</li>
</ul>
Yes, only three files you need to create. But to write the C header files and the .c file, there are still many things to understand and to be configured well.<br />
<br />
With GenPHP <a href="http://github.com/c9s/GenPHP">http://github.com/c9s/GenPHP</a> you don't need to write these files by yourself. By using GenPHP, you can simply run a single command to generate these files through a simple template engine.<br />
<br />
To get GenPHP works, first you need to install it:<br />
<pre><code>$ curl -O https://raw.github.com/c9s/GenPHP/master/genphp
$ chmod +x genphp
$ mv genphp /usr/bin/
</code></pre>
Then, to generate something you need to install the GenPHP flavours:<br />
<pre><code> $ git clone https://github.com/c9s/GenPHP-Flavors ~/.genphp/flavors
</code></pre>
Now run <code>genphp list</code>, you should see the flavour list:<br />
<pre><code> $ genphp list
Available flavors:
extension /Users/c9s/.genphp/flavors
</code></pre>
OK, now we've got the extension flavor, to use it, simply type:<br />
<pre><code> $ mkdir app
$ cd app
$ genphp new extension app
Loading flavor extension...
Running main generator...
render config.m4
render php_app.h
render php_app.c
copy .gitignore
Done
</code></pre>
See? it's really easy.<br />
The "app" above is your extension name, you may just replace the "app" with anything you want.<br />
To build the basic extension, you can type the commands to build the extension as usual:<br />
<pre><code> $ phpize
$ ./configure
$ make
$ make install
</code></pre>
The extension flavor creates a basic extension for you, which contains a simple PHP function, see below:<br />
<pre><code> PHP_FUNCTION(app_test)
{
RETURN_STRING("Hello World", 1);
}
</code></pre>
Now you can simply start here with ease!<br />
<h3>
Testing</h3>
To test your extension code, there is already a tool called "run-tests.sh", which is shipped from PHP distribution.<br />
If you ever used it, you should know it's really hard to do the tests and use gdb to debug. <br />
<h4>
The Old Way</h4>
To debug your php extension, you need setup these configuration by yourself:<br />
<br />
You need to create your own .gdbinit with the content below:<br />
<br />
file /Users/c9s/.phpbrew/php/php-5.4.12/bin/php
set args -d 'output_handler=' -d 'open_basedir=' -d 'safe_mode=0' -d 'disable_functions=' -d 'output_buffering=Off' -d 'error_reporting=32767' -d 'display_errors=1' -d 'display_startup_errors=1' -d 'log_errors=0' -d 'html_errors=0' -d 'track_errors=1' -d 'report_memleaks=1' -d 'report_zend_debug=0' -d 'docref_root=' -d 'docref_ext=.html' -d 'error_prepend_string=' -d 'error_append_string=' -d 'auto_prepend_file=' -d 'auto_append_file=' -d 'magic_quotes_runtime=0' -d 'ignore_repeated_errors=0' -d 'precision=14' -d 'memory_limit=128M' -d 'extension_dir=/Users/c9s/src/work/php/fileutil/modules/' -d 'session.auto_start=0' -d 'zlib.output_compression=Off' -d 'mbstring.func_overload=0' -d 'extension=fileutil.so' -n {your PHP script}<br />
<br />
Now you should understand the hard place.<br />
<br />
2. The phpt does not show the expected result and actual result very clearly, please see the actual output below:<br />
<pre>=====================================================================
PHP : /Users/c9s/.phpbrew/php/php-5.4.12/bin/php
PHP_SAPI : cli
PHP_VERSION : 5.4.12
ZEND_VERSION: 2.4.0
PHP_OS : Darwin - Darwin c9smba.local 12.3.0 Darwin Kernel Version 12.3.0: Sun Jan 6 22:37:10 PST 2013; root:xnu-2050.22.13~1/RELEASE_X86_64 x86_64
INI actual : /Users/c9s/.phpbrew/build/php-5.4.12/ext/tidy/tmp-php.ini
More .INIs :
CWD : /Users/c9s/.phpbrew/build/php-5.4.12/ext/tidy
Extra dirs :
VALGRIND : Not used
=====================================================================
TIME START 2013-03-20 15:54:16
=====================================================================
PASS Check for tidy presence [tests/001.phpt]
PASS tidy_parse_string() [tests/002.phpt]
PASS tidy_clean_repair() [tests/003.phpt]
FAIL tidy_diagnose() [tests/004.phpt]
PASS tidy_parse_file() [tests/005.phpt]
FAIL Verbose tidy_get_error_buffer() [tests/006.phpt]
PASS Verbose tidy_getopt() [tests/007.phpt]
FAIL Accessing the error buffer via $obj->error_buf... [tests/008.phpt]
PASS tidy_doc object overloading [tests/009.phpt]
FAIL Accessing root, body, html, and head nodes.. [tests/010.phpt]
PASS Accessing attributes of a node [tests/011.phpt]
FAIL Accessing children nodes [tests/012.phpt]
PASS Parsing a file using constructor [tests/013.phpt]
PASS Passing configuration options through tidy_parse_string(). [tests/014.phpt]
PASS Passing configuration options through tidy_parse_file(). [tests/015.phpt]
PASS Passing configuration file through tidy_parse_file() (may fail with buggy libtidy) [tests/016.phpt]
PASS The Tidy Output Buffer Filter [tests/017.phpt]
PASS binary safety [tests/018.phpt]
PASS tidy_repair_*() and invalid parameters [tests/019.phpt]
PASS OO API [tests/020.phpt]
PASS tidy_get_opt_doc() [tests/021.phpt]
PASS tidy_repair_*() and invalid parameters [tests/022.phpt]
PASS tidy and tidyNode OO [tests/023.phpt]
SKIP libtidy handling of 'new-blocklevel-tags' [tests/024.phpt] reason: old libtidy
PASS tidyNode tests [tests/025.phpt]
PASS tidy.clean_output test [tests/026.phpt]
PASS Bug: tidy segfaults with markup=false [tests/027.phpt]
PASS tidyNode::getParent() [tests/028.phpt]
PASS tidy_get_body() crash [tests/029.phpt]
PASS getConfig() method - basic test for getConfig() [tests/030.phpt]
PASS tidy_config_count() function - basic test for tidy_config_count() [tests/031.phpt]
PASS tidy_error_count() function - basic test for tidy_error_count() [tests/032.phpt]
PASS tidy_warning_count() function - basic test for tidy_warning_count() [tests/033.phpt]
PASS tidy_access_count() function - basic test for tidy_access_count() [tests/034.phpt]
PASS tidyNode::__construct() [tests/035.phpt]
PASS Tidy::diagnose() NULL pointer dereference [tests/bug54682.phpt]
PASS Bug #50558 - Broken object model when extending tidy [tests/bug_50558.phpt]
PASS Ensure tidy_get_status() returns correct status [tests/tidy_error.phpt]
PASS Notice triggered by invalid configuration options [tests/tidy_error1.phpt]
=====================================================================
TIME END 2013-03-20 15:54:19
=====================================================================
TEST RESULT SUMMARY
---------------------------------------------------------------------
Exts skipped : 0
Exts tested : 49
---------------------------------------------------------------------
Number of tests : 39 38
Tests skipped : 1 ( 2.6%) --------
Tests warned : 0 ( 0.0%) ( 0.0%)
Tests failed : 5 ( 12.8%) ( 13.2%)
Expected fail : 0 ( 0.0%) ( 0.0%)
Tests passed : 33 ( 84.6%) ( 86.8%)
---------------------------------------------------------------------
Time taken : 3 seconds
=====================================================================
=====================================================================
FAILED TEST SUMMARY
---------------------------------------------------------------------
tidy_diagnose() [tests/004.phpt]
Verbose tidy_get_error_buffer() [tests/006.phpt]
Accessing the error buffer via $obj->error_buf... [tests/008.phpt]
Accessing root, body, html, and head nodes.. [tests/010.phpt]
Accessing children nodes [tests/012.phpt]
=====================================================================
You may have found a problem in PHP.
This report can be automatically sent to the PHP QA team at
http://qa.php.net/reports and http://news.php.net/php.qa.reports
This gives us a better understanding of PHP's behavior.
If you don't want to send the report immediately you can choose
option "s" to save it. You can then email it to qa-reports@lists.php.net later.
Do you want to send this report now? [Yns]:
</pre>
<br />
As you seen, it only shows "FAIL" and "PASS" and it's asking you whether to send the test report.. it's really excruciating..<br />
<br />
3. If you have both pure PHP implementation and the C extension implementation, it's hard to switch and test them.<br />
<h4>
ExtUnit</h4>
We developed ExtUnit to improve the extension unit test, you can even write your extension in PHPUnit, and with ExtUnit, you can easily run the tests with your pure PHP implementation or with your extension implementation by two simple commands.<br />
Install ExtUnit:<br />
<pre><code> $ pear channel-discover pear.corneltek.com
$ pear install -f -a corneltek/ExtUnit
</code></pre>
To let ExtUnit work, you need to define the <code>extunit.xml</code> config file:<br />
<pre><code><?xml version="1.0" encoding="UTF-8"?>
<extunit>
<!-- local extensions for php to load -->
<extension>fileutil</extension>
</extunit>
</code></pre>
Then you can simply type the command to phpunit tests:<br />
<pre><code> $ extunit --phpunit
</code></pre>
Or use gdb to debug the test cases:<br />
<pre><code> $ extunit --gdb --phpunit
</code></pre>
Or simply run a php script with gdb:<br />
<pre><code> $ extunit --gdb example.php
</code></pre>
ExtUnit runs "make" before you run the tests, so you can simply run single command to test, which improves the extension development iteration.<br />
Now you might want to test your pure PHP implementation, just type the phpunit as usual:<br />
<pre><code> $ phpunit
</code></pre>
Done!Arrakeenhttp://www.blogger.com/profile/05514217676033260267noreply@blogger.com0tag:blogger.com,1999:blog-3468229370686138544.post-11960940205771684992013-02-18T00:12:00.003+08:002013-02-18T00:12:56.606+08:00Golang: the performance of GoroutinesFound this article about the performance of Goroutines: <a href="http://en.munknex.net/2011/12/golang-goroutines-performance.html">http://en.munknex.net/2011/12/golang-goroutines-performance.html</a><br />
<br />
The performance is just tremendous awesome, you should really check out this article.Arrakeenhttp://www.blogger.com/profile/05514217676033260267noreply@blogger.com0tag:blogger.com,1999:blog-3468229370686138544.post-58151424059244396802013-02-17T14:07:00.004+08:002013-02-17T14:07:53.894+08:00GoTray 1.4.2 is released<div class="separator" style="clear: both; text-align: left;">
<a href="http://gotray.extremedev.org/">GoTray</a> 1.4.2 is released:</div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<ul>
<li>"Watch and Test" feature is added.</li>
<li>Multiple window to monitor projects, tasks.</li>
<li>Support CGO environment variable</li>
<li>Project settings editor.</li>
</ul>
<br />
No more talking, here is the screenshot:<br />
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjv4yM6bnuO4zDudx-gWQBuIWLYPYVmp9f89nUb3NZ44WbImBilE5EQ1lUkNB7dZTWpVf3LdQMIKs0c-gpWPON-Bi1x8okEf6JHseHeGjiZgrprJS5HbTZkkW_z8Q-eZ_b1uxbsYip7cFH8/s1600/screen1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjv4yM6bnuO4zDudx-gWQBuIWLYPYVmp9f89nUb3NZ44WbImBilE5EQ1lUkNB7dZTWpVf3LdQMIKs0c-gpWPON-Bi1x8okEf6JHseHeGjiZgrprJS5HbTZkkW_z8Q-eZ_b1uxbsYip7cFH8/s400/screen1.png" width="400" /></a></div>
<br />
You can use GoTray with your favorite editor to do the automatic continuous testing:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjO8Po39-TyYcBODrrVwhJ5mi7LmQgyh0y66frt2R4yuhCxe5WWl_BG_VGmIxnwHozoVtCdueNb8N31jvygcfekwlC-E8nHK1kIITT_JQ3TRvIDoxeccUVzwp7U4RdL8w4rKpeUUNGFktDR/s1600/screen2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="276" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjO8Po39-TyYcBODrrVwhJ5mi7LmQgyh0y66frt2R4yuhCxe5WWl_BG_VGmIxnwHozoVtCdueNb8N31jvygcfekwlC-E8nHK1kIITT_JQ3TRvIDoxeccUVzwp7U4RdL8w4rKpeUUNGFktDR/s400/screen2.png" width="400" /></a></div>
<br />Arrakeenhttp://www.blogger.com/profile/05514217676033260267noreply@blogger.com0tag:blogger.com,1999:blog-3468229370686138544.post-85480246040485523042013-02-15T22:41:00.002+08:002013-02-15T22:55:04.670+08:00GoTray 1.3.3<div class="separator" style="clear: both; text-align: center;">
<a href="http://gotray.extremedev.org/images/side-screen.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://gotray.extremedev.org/images/side-screen.png" /></a></div>
<br />
<a href="http://gotray.extremedev.org/">GoTray</a> 1.3.3 is released, <a href="http://gotray.extremedev.org/">GoTray</a> aims to be a small, faster continuous integration system for your local environment.<br />
<br />
Just download it and enjoy the fast iteration with <a href="http://gotray.extremedev.org/">GoTray</a>.Arrakeenhttp://www.blogger.com/profile/05514217676033260267noreply@blogger.com0tag:blogger.com,1999:blog-3468229370686138544.post-81929523572487471262013-02-10T02:41:00.002+08:002013-02-11T01:18:45.334+08:00GoTray for Mac OS<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgm02r9HspvHe1I2fwTvw2LlO9_lSgmgz0ovkfTsQg56R7spWVOESX73jt1MNqj32PqyoqC7qvUFWMSSC6F1DCZi0-btDECmGyyVRqg2KAjlh3p9XZpQZKlVh1QrL1d6g7HH8-60G9zrr4I/s1600/%E8%9E%A2%E5%B9%95%E5%BF%AB%E7%85%A7+2013-02-10+4.16.31+AM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgm02r9HspvHe1I2fwTvw2LlO9_lSgmgz0ovkfTsQg56R7spWVOESX73jt1MNqj32PqyoqC7qvUFWMSSC6F1DCZi0-btDECmGyyVRqg2KAjlh3p9XZpQZKlVh1QrL1d6g7HH8-60G9zrr4I/s1600/%E8%9E%A2%E5%B9%95%E5%BF%AB%E7%85%A7+2013-02-10+4.16.31+AM.png" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<br />
I made this Mac OS App after work today - GoTray, which is an application manages your godoc server process, you can simply click to start a godoc server or stop it.<br />
<br />
It will automatically opens your browser to open the local godoc web documentation.<br />
<br />
While I decided to upload this Mac OS App to the Mac OS App Store, and I found one thing, which is that developers *MUST* enable the "Entitlement" feature in their XCode, and the App Sandboxing should also be enabled to pass the binary validation.<br />
<br />
Unfortunately this was announced in the last year, and which means any application related with filesystem, system commands won't be uploaded to Mac App Store...<br />
<br />
<a href="http://gotray.extremedev.org/">Click here</a> to download "GoTray"Arrakeenhttp://www.blogger.com/profile/05514217676033260267noreply@blogger.com0tag:blogger.com,1999:blog-3468229370686138544.post-13060128511018844562012-11-29T11:50:00.005+08:002012-11-29T11:50:47.388+08:00Golang: Installing Go PostgreSQL DriverTo install Go PostgreSQL driver (with CGO), you need to specify CGO_LDFLAGS and CGO_CFLAGS for your pg_config<br />
<br />
<pre>CGO_CFLAGS="-I`pg_config --includedir`" CGO_LDFLAGS="-L`pg_config --libdir` -lpq" go get github.com/jbarham/gopgsqldriver</pre>
Arrakeenhttp://www.blogger.com/profile/05514217676033260267noreply@blogger.com0tag:blogger.com,1999:blog-3468229370686138544.post-28074457509631315752012-11-29T11:50:00.001+08:002012-11-29T11:50:52.541+08:00Golang: Create your local environemnt<p>Generally, you can install Go from the package installer that Go provides.</p>
<p>But as you need to install packages, you need root permission to install packages into the default system GOROOT path (like /usr/local or /opt/local.. etc)</p>
<p>You can provide your own GOPATH to avoid this kind of problem.</p>
<p>First, you should create a directory structure like this:</p>
<pre><code> ~/mygo
~/mygo/pkg
~/mygo/src
~/mygo/bin
</code></pre>
<p>Then, export this path (~/mygo) to your GOPATH in your .bashrc or .zshrc file:</p>
<pre><code> export GOPATH=$HOME/mygo:$GOPATH
</code></pre>
<p>And the bin path of Go:</p>
<pre><code> export PATH=$HOME/mygo/bin:$PATH
</code></pre>
<p>Done. Now you can install packages into your own local go environment. for example:</p>
<pre><code> go get https://bitbucket.org/mikespook/gearman-go
</code></pre>
<p>which won't require you to sudo.</p>
<p>If you need to install packages from local, you need to move your package source to ~/mygo/src directory, then
build the package there, or Go will complain about <code>go install: no install location for ...</code></p>
Arrakeenhttp://www.blogger.com/profile/05514217676033260267noreply@blogger.com0