<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
    <title>Sebastian Riedel - Perl and the Web</title>
    <link rel="alternate" type="text/html" href="http://labs.kraih.com/blog/" />
    <link rel="self" type="application/atom+xml" href="http://labs.kraih.com/blog/atom.xml" />
    <id>tag:labs.kraih.com,2008-09-23:/blog//1</id>
    <updated>2009-06-29T19:45:57Z</updated>
    
    <generator uri="http://www.sixapart.com/movabletype/">Movable Type 4.21-en</generator>

<entry>
    <title>Mojo 0.991231 released</title>
    <link rel="alternate" type="text/html" href="http://labs.kraih.com/blog/2009/06/mojo-0991231-released.html" />
    <id>tag:labs.kraih.com,2009:/blog//1.29</id>

    <published>2009-06-29T17:39:04Z</published>
    <updated>2009-06-29T19:45:57Z</updated>

    <summary>We have just released the last big milestone on the way towards Mojo 1.0, everything from now on will be just documentation, artwork and other polishing tasks. As usual there are awesome new features such as HTTP 1.1 pipelining, format...</summary>
    <author>
        <name>Sebastian</name>
        
    </author>
    
        <category term="Perl" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en-US" xml:base="http://labs.kraih.com/blog/">
        <![CDATA[We have just released the last big milestone on the way towards <a href="http://mojolicious.org">Mojo</a> 1.0, everything from now on will be just documentation, artwork and other polishing tasks.<br /><br />

As usual there are awesome new features such as <a href="http://labs.kraih.com/blog/2009/04/http-11-pipelining-in-mojo.html">HTTP 1.1 pipelining</a>, format handling, layout support and a brand new routes syntax.<br /><br />

Thanks to our <a href="http://code.google.com/soc/">GSOC</a> Student <a href="http://fooko.blogspot.com/">Pascal Gaudette</a> who squashed many <a href="http://www.ietf.org/rfc/rfc2616.txt">RFC</a> related bugs we are now even further ahead of other HTTP implementations on CPAN.
And the best of all, after some refactoring the whole HTTP 1.1 client/server state machine is now completely reusable and independent from the IO layer.
This will make modules such as <a href="http://search.cpan.org/dist/AnyEvent-Mojo/">AnyEvent::Mojo</a> absolutely trivial in the future.<br /><br />

And while we are at it, here's a preview of the new "fluffy cloud" Mojo logo!
<img src="http://kraih.com/mojo-pinstripe.png"><br /><br />

The complete changelog.
<blockquote>
        - Rewrote MojoX::Renderer, it is not backward compatible and
          templates need to be renamed in the following 3 part format
          "index.html.tt"!<br />
        - Added exception support to MojoX::Dispatcher::Routes, this change
          is not backward compatible and "dispatch" calls now return
          exception objects for errors and false otherwise.<br />
        - Changed routes syntax, this change is not backward compatible and
          you need to change all your existing routes.<br />
            "/:foo" becomes "/(foo)"<br />
            "/^foo" becomes "/((foo))"<br />
            "/*foo" becomes "/(((foo)))"<br />
        - Added full HTTP 1.1 pipelining support to all Mojo layers.<br />
        - Added layout support to MojoX::Renderer.<br />
        - Made render call optional.<br />
        - Added format support to MojoX::Routes.<br />
        - Added Mojo::Loader::Exception.<br />
        - Added wildcard symbol support to MojoX::Routes and rewrote many
          routes internals.<br />
        - Added Makefile.PL generator.<br />
        - Added HttpOnly support to Mojo::Cookie. (burak)<br />
        - Support more CGI implementations.<br />
        - Added support for namespaces only dispatching in
          MojoX::Dispatcher::Routes.<br />
        - Added encoding support to Mojo::Template and made "utf8" the
          default.<br />
        - Added HEAD support to Mojo::Server::Daemon. (acajou)<br />
        - Added new relaxed placeholder to MojoX::Routes::Pattern.<br />
        - Added Mojo::Template::Exception.<br />
        - Added HEAD support to the Mojo::Transaction state machine and
          related modules. (acajou)<br />
        - Added safe_post option to Mojo::Pipeline. (acajou)<br />
        - Made chained => 1 the default in Mojo::Base.<br />
        - Fixed compiler bug in Mojo::Template that prevented more advanced
          control structures, you might have to add additional semicolons to
          some of your templates.<br />
        - Fixed Mojo::Date to not crash on invalid dates. (vti)<br />
        - Fixed chunked support in Mojo::Server::Daemon and Mojo::Client.<br />
        - Fixed tokenizer in MojoX::Routes::Pattern to support "0" values.
          (Anatoly Sharifulin)<br />
        - Fixed parsing of "0" in Mojo::Path. (charsbar)<br />
        - Fix server tests on win32. (charsbar)<br />
        - Fixed leading whitespace problem in the request parser. (acajou)<br />
        - Fixed broken pipe problem in Mojo::Server::CGI. (vti)<br />
        - Added more diagnostics options to Mojo::HelloWorld. (uwe)<br />
        - Fixed empty cookie parsing. (vti)<br />
        - Fixed a case where child processes migth hang in
          Mojo::Server::Daemon::Prefork. (gbarr)<br />
        - Fixed a bug in MojoX::Dispatcher::Routes where the renderer would
          be called with an empty stack. (melo)<br />
        - Fixed a escaping problem in Mojo::Parameters. (vti)<br />
        - Updated Mojo::URL to be more template friendly.<br />
        - Improved Solaris compatibility.<br />
</blockquote><br /><br />

P.S. In case you were wondering, the version number is the date of the first futurama episode. ;)]]>
        
    </content>
</entry>

<entry>
    <title>HTTP 1.1 pipelining in Mojo</title>
    <link rel="alternate" type="text/html" href="http://labs.kraih.com/blog/2009/04/http-11-pipelining-in-mojo.html" />
    <id>tag:labs.kraih.com,2009:/blog//1.28</id>

    <published>2009-04-19T01:49:47Z</published>
    <updated>2009-04-19T02:06:51Z</updated>

    <summary>I&apos;ve just committed a huge change adding full HTTP 1.1 pipelining support to all layers of Mojo. This makes Mojo the first Perl HTTP implementation to support this feature on the client and server side (not counting LWPng), yay! Now...</summary>
    <author>
        <name>Sebastian</name>
        
    </author>
    
        <category term="Perl" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en-US" xml:base="http://labs.kraih.com/blog/">
        <![CDATA[I've just committed a <a href="http://github.com/kraih/mojo/commit/3114e47ddcbe132a1f0298572caf18231c8313fc">huge change</a> adding full HTTP 1.1 pipelining support to all layers of <a href="http://mojolicious.org">Mojo</a>.
This makes Mojo the first Perl HTTP implementation to support this feature on the client and server side (not counting <a href="http://search.cpan.org/dist/LWPng-alpha/">LWPng</a>), yay!<br /><br />

Now you might be wondering "wtf is pipelining"? Let me try to explain it with a little illustration.
<img src="http://kraih.com/pipelining.jpg" />
<a href="http://en.wikipedia.org/wiki/HTTP_pipelining">This Wikipedia page</a> has more informations if you are interested. I'm really looking forward to MojoX::UserAgent, which hopefully will be a <a href="http://code.google.com/soc/">Google Summer of Code</a> project and make great use of pipelining.]]>
        
    </content>
</entry>

<entry>
    <title>Mojo Documentation</title>
    <link rel="alternate" type="text/html" href="http://labs.kraih.com/blog/2009/03/mojo-documentation.html" />
    <id>tag:labs.kraih.com,2009:/blog//1.27</id>

    <published>2009-03-22T19:41:28Z</published>
    <updated>2009-03-23T00:55:13Z</updated>

    <summary>Back in December 2008 the Perl Foundation accepted my grant application for the Mojo Documentation Project. Sadly i had to delay all grant work because of health problems until now. But things are finally getting better and i&apos;m highly motivated...</summary>
    <author>
        <name>Sebastian</name>
        
    </author>
    
        <category term="Perl" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en-US" xml:base="http://labs.kraih.com/blog/">
        <![CDATA[Back in December 2008 the <a href="http://www.perlfoundation.org">Perl Foundation</a> accepted my <a href="http://www.perlfoundation.org/sebastian_riedel_the_mojo_documentation_project">grant application</a> for the <a href="http://mojolicious.org">Mojo</a> Documentation Project.
Sadly i had to delay all grant work because of health problems until now.
But things are finally getting better and i'm highly motivated to get back to work.<br /><br />
I know some of you can't wait, so here's a little sneak preview of the chapters. (the first chapter should hit the <a href="http://github.com/kraih/mojo/tree/master">github repository</a> soon)
<pre>
Mojo::Manual::GettingStarted - Step by step instructions to get you started with Mojo.
    * Installation
    * Running the development server
    * Writing your first micro application and testing it

Mojo::Manual::Transaction - Everything in Mojo was built around the idea of processing HTTP requests as transactions.
    * HTTP Messages
    * Request
    * Response
    * Cookies
    * Parameters
    * Content

Mojo::Manual::Deployment - Running Mojo applications in different environemnts.
    * Designed for portability
    * Built in servers
    * CGI
    * FastCGI
    * Easy to extend

Mojo::Manual::Mojolicious - Introduction to Mojolicious, the Mojo example web framework.
    * The MVC design pattern
    * Application class
    * Dispatchers
    * Controllers
    * Routes
    * Renderer and templates
    * Modes

Mojo::Manual::MojoliciousExample - Building your first real web application with Mojolicious, a POD reader.
    * Directory structure
    * Model
    * Controller
    * Templates
    * Testing

Mojo::Manual::Cookbook - Cooking with Mojo and Mojolicious.
</pre>
Note that i've disabled comments on my blog, but you can still send trackbacks. ;)]]>
        
    </content>
</entry>

<entry>
    <title>Google Voice</title>
    <link rel="alternate" type="text/html" href="http://labs.kraih.com/blog/2009/03/google-voice.html" />
    <id>tag:labs.kraih.com,2009:/blog//1.26</id>

    <published>2009-03-12T20:05:43Z</published>
    <updated>2009-03-12T20:10:00Z</updated>

    <summary>via NY Times It unifies your phone numbers, transcribes your voice mail, blocks telemarketers and elevates text messages to first-class communication citizens. And that’s just the warm-up... ...Each time you answered a call, while the caller was still hearing “one...</summary>
    <author>
        <name>Sebastian</name>
        
    </author>
    
        <category term="Privacy" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en-US" xml:base="http://labs.kraih.com/blog/">
        <![CDATA[via <a href="http://www.nytimes.com/2009/03/12/technology/personaltech/12pogue.html">NY Times</a><br />
<blockquote>
It unifies your phone numbers, transcribes your voice mail, blocks telemarketers and elevates text messages to first-class communication citizens. And that’s just the warm-up...<br /><br /> ...Each time you answered a call, while the caller was still hearing “one ringy-dingy, two ringy-dingies,” you heard a recording offering four ways to handle the call: “Press 1 to accept, 2 to send to voice mail, 3 to listen in on voice mail, or 4 to accept and record the call.” If you pressed 3, the call went directly to voice mail, but you could listen in. If you felt that the caller deserved your immediate attention, you could press * to pick up and join the call. This subtle feature saved time, conserved cellular minutes and, in certain cases, avoided a great deal of interpersonal conflict...<br /><br /> ...If you dial your own Google Voice number from one of your phones, you’re offered an option to call overseas at rates even lower than Skype’s (and much lower than your cellphone company’s): 2 cents a minute to France or China, 3 cents to Chile or the Czech Republic. Sweet.
</blockquote>
This could really shake up the telco business, but do i want Google to transcribe and possibly index all my voice mail?]]>
        
    </content>
</entry>

<entry>
    <title>Mozilla Bespin</title>
    <link rel="alternate" type="text/html" href="http://labs.kraih.com/blog/2009/02/bespin.html" />
    <id>tag:labs.kraih.com,2009:/blog//1.25</id>

    <published>2009-02-18T14:24:56Z</published>
    <updated>2009-03-11T17:35:32Z</updated>

    <summary><![CDATA[Bespin from the Mozilla Labs is full featured text editor implemented with Javascript and the HTML 5 &lt;canvas&gt; element. Very impressive and crazy, i'll have to keep an eye on this. View Introduction to Bespin...]]></summary>
    <author>
        <name>Sebastian</name>
        
    </author>
    
        <category term="Javascript" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en-US" xml:base="http://labs.kraih.com/blog/">
        <![CDATA[<a href="http://labs.mozilla.com/projects/bespin/">Bespin</a> from the <a href="http://labs.mozilla.org">Mozilla Labs</a> is full featured text editor implemented with Javascript and the HTML 5 &lt;canvas&gt; element. Very impressive and crazy, i'll have to keep an eye on this.
<p>
<object width="480" height="270"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=3195079&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=0&amp;show_portrait=0&amp;color=01AAEA&amp;fullscreen=1" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=3195079&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=0&amp;show_portrait=0&amp;color=01AAEA&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="480" height="270"></embed></object><br />
<a href="http://vimeo.com/3195079">View Introduction to Bespin</a>
</p>]]>
        
    </content>
</entry>

<entry>
    <title>Perl community not generating any internal buzz...</title>
    <link rel="alternate" type="text/html" href="http://labs.kraih.com/blog/2009/02/perl-community-not-generating-any-internal-buzz.html" />
    <id>tag:labs.kraih.com,2009:/blog//1.24</id>

    <published>2009-02-17T13:36:00Z</published>
    <updated>2009-03-11T17:35:49Z</updated>

    <summary>via Marcus Chromatic points to a trend in the Perl community of not giving any link love to our own. Somehow, it feels like I’ve heard this before. I agree this is a negative trend, but I find it amusing...</summary>
    <author>
        <name>Sebastian</name>
        
    </author>
    
        <category term="Perl" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en-US" xml:base="http://labs.kraih.com/blog/">
        <![CDATA[via <a href="http://marcus.nordaaker.com/2009/02/perl-community-not-generating-any-internal-buzz/">Marcus</a><br />
<blockquote>
<a href="http://use.perl.org/~chromatic/journal/">Chromatic</a> points to a trend in the Perl community of not giving any link love to our own. Somehow, it feels like I’ve <a href="http://hanekomu.at/blog/2008/09/20#20080920-1033-putting_your_money_where_your_mouth_is">heard this before</a>. I agree this is a negative trend, but I find it amusing that it comes from chromatic, the only posters I can remember him linking to in his journal is people spreading FUD about Perl, in is mission to refute their statements. Somehow it seems to me like linking to these people and giving them attention is only making them stronger…
</blockquote>
There is a lot of truth to this, somehow people prefer to complain about the problem instead of actually starting some <a href="http://use.perl.org/~chromatic/journal/">link</a> <a href="http://marcus.nordaaker.com">love</a>.]]>
        
    </content>
</entry>

<entry>
    <title>xkcd++</title>
    <link rel="alternate" type="text/html" href="http://labs.kraih.com/blog/2009/02/xkcd.html" />
    <id>tag:labs.kraih.com,2009:/blog//1.23</id>

    <published>2009-02-17T13:07:35Z</published>
    <updated>2009-03-11T17:36:01Z</updated>

    <summary></summary>
    <author>
        <name>Sebastian</name>
        
    </author>
    
        <category term="Perl" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en-US" xml:base="http://labs.kraih.com/blog/">
        <![CDATA[<a href="http://xkcd.com/224/"><img src="http://imgs.xkcd.com/comics/lisp.jpg"></a>]]>
        
    </content>
</entry>

<entry>
    <title>Mojo 0.9 released</title>
    <link rel="alternate" type="text/html" href="http://labs.kraih.com/blog/2008/12/mojo-09-released.html" />
    <id>tag:labs.kraih.com,2008:/blog//1.22</id>

    <published>2008-12-02T10:40:32Z</published>
    <updated>2009-03-11T17:36:10Z</updated>

    <summary>Our biggest update so far, with many awesome new features like built in log file support and Modes. Mojolicious got even more userfriendly, take a look! - Added modes to Mojolicious. - Added Mojo::Log and log support for Mojo/Mojolicious. -...</summary>
    <author>
        <name>Sebastian</name>
        
    </author>
    
        <category term="Perl" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en-US" xml:base="http://labs.kraih.com/blog/">
        <![CDATA[Our biggest update so far, with many awesome new features like built in log file support and <a href="http://labs.kraih.com/blog/2008/11/environments-for-mojolicious.html">Modes</a>.
Mojolicious got even more <a href="http://labs.kraih.com/blog/2008/11/small-things-that-make-a-big-difference.html">userfriendly</a>, <a href="http://mojolicious.org">take a look</a>!
<blockquote>
        - Added modes to Mojolicious.<br />
        - Added Mojo::Log and log support for Mojo/Mojolicious.<br />
        - Changed MojoX::Renderer and Mojo::Template api to make catching
          errors easier, we now use a scalar ref for results like most
          template engines.<br />
        - Added MojoX::Context.<br />
        - Added multi level controller class support to Mojolicious.<br />
        - MojoX::Dispatcher::Routes should be able to fail.<br />
        - Added diagnostics functions to Mojo::HelloWorld.<br />
        - Made the env parser Apache compatible.<br />
        - Made Mojo::Server::FastCGI Apache compatible.<br />
        - Added namespace, class and method captures to
          MojoX::Dispatcher::Routes.<br />
        - Made url_for work for rebased applications.<br />
        - Added ctx, render, req, res and stash methods to Mojolicious
          controllers.<br />
        - Changed cookie, param and upload in Mojo::Parameters to return a
          list.<br />
        - Added support for templateless renderers to MojoX::Renderer.<br />
        - Added blacklist to MojoX::Dispatcher::Routes.<br />
        - Fixed Mojo::Date bugs. (vti)<br />
        - Fixed / routes matching too much.<br />
        - New Windows workaround in Mojo::Client and Mojo::Server::Daemon.<br />
        - Cleaned up Mojo::Transaction. (Ask Bjoern Hansen)<br />
        - Added .perltidyrc. (Ask Bjoern Hansen)<br />
        - Allow chains to be broken with return values in
          MojoX::Dispatcher::Routes.<br />
        - The stack in MojoX::Routes resets now.<br />
        - Renamed default_handler to default_format in MojoX::Renderer.<br />
        - Disallow actions beginning with _ in MojoX::Dispatcher::Routes.<br />
        - Preload application in servers. (Graham Barr)<br />
        - Renamed is_version to at_least_version. (Mark Stosberg)<br />
        - Added documentation. (Ch Lamprecht)<br />
        - Added param tests. (Mark Stosberg)<br />
        - Added documentation for Mojo::Log. (Mark Stosberg)<br />
        - Add test for MojoX::Renderer. (Mark Stosberg)<br />
        - When testing, allow servers a few seconds to stop. (Leon Brocard)
        - Fixed typos.<br />
</pre>]]>
        
    </content>
</entry>

<entry>
    <title>Small things that make a big difference</title>
    <link rel="alternate" type="text/html" href="http://labs.kraih.com/blog/2008/11/small-things-that-make-a-big-difference.html" />
    <id>tag:labs.kraih.com,2008:/blog//1.21</id>

    <published>2008-11-27T11:22:59Z</published>
    <updated>2009-03-11T17:36:19Z</updated>

    <summary>Mojolicious and Catalyst actions have always been very similar since i&apos;ve basically cargo culted them both from Maypole. But we&apos;ve never been happy with the idea of explicitly passing around the context object in Mojolicious. sub list { my ($self,...</summary>
    <author>
        <name>Sebastian</name>
        
    </author>
    
        <category term="Perl" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en-US" xml:base="http://labs.kraih.com/blog/">
        <![CDATA[<a href="http://mojolicious.org">Mojolicious</a> and Catalyst actions have always been very similar since i've basically cargo culted them both from Maypole. But we've never been happy with the idea of explicitly passing around the context object in Mojolicious.
<pre><code class="perl">
sub list {
    my ($self, $c) = @_;
    $self->_list($c);
    $c->render;
}

sub _list {
    my ($self, $c) = @_;
    $c->stash(items => [qw/23 54/]);
}
</code></pre>
<a href="http://www.askbjoernhansen.com/">Ask Bjoern Hansen</a> recently proposed a small change to this which got a discussion started.
<pre><code class="perl">
sub list {
    my $self = shift;
    $self->_list;
    $self->ctx->render;
}

sub _list {
    my $self = shift;
    $self->ctx->stash(items => [qw/23 54/]);
}
</code></pre>
Making the context a controller attribute was a big step forward but still couldn't be considered beautiful. After some more unsuccessful tries <a href="http://mark.stosberg.com/">Mark Stosberg</a> popped up with some <a href="http://search.cpan.org/dist/CGI-Application/">CGI::Application</a> examples, and it totally made sense for us.
<pre><code class="perl">
sub list {
    my $self = shift;
    $self->_list;
    $self->render;
}

sub _list {
    my $self = shift;
    $self->stash(items => [qw/23 54/]);
}
</code></pre>
All we had to do to make it finally beautiful was adding the 4 most often used methods/attributes from the context to the controller.
<pre><code class="perl">
sub test {
    my $self = shift;

    # Request
    my $req = $self->req;

    # Response
    my $res = $self->res;

    # Stash
    $self->stash(foo => 23);

    # Renderer
    $self->render;
}
</code></pre>
It's incredible how much of a difference such a minor change can make usability wise.]]>
        
    </content>
</entry>

<entry>
    <title>Environments for Mojolicious</title>
    <link rel="alternate" type="text/html" href="http://labs.kraih.com/blog/2008/11/environments-for-mojolicious.html" />
    <id>tag:labs.kraih.com,2008:/blog//1.20</id>

    <published>2008-11-11T13:09:04Z</published>
    <updated>2009-03-11T17:36:28Z</updated>

    <summary>Back in the days when i was working on Catalyst, i thought it would be a great idea to have a special debug environment. You could activate it with a simple -Debug flag in the import list. But what if...</summary>
    <author>
        <name>Sebastian</name>
        
    </author>
    
        <category term="Perl" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en-US" xml:base="http://labs.kraih.com/blog/">
        <![CDATA[Back in the days when i was working on Catalyst, i thought it would be a great idea to have a special debug environment.
You could activate it with a simple <i>-Debug</i> flag in the import list.
But what if your development process has more stages than development and production?
Right, you are screwed.
That's why we've decided to use a more ambitious concept we call <b>Modes</b> in <a href="http://mojolicious.org">Mojolicious</a>, where you can have an unlimited number of different environments.
<pre><code class="perl">
package MyApp;
use base 'Mojolicious';

sub production_mode {
    my $self = shift;

    # Production templates
    $self->renderer->root('/Users/production/templates');
}

sub development_mode {
    my $self = shift;

    # Development templates
    $self->renderer->root('/Users/dev/templates');
}

sub startup {
    my $self = shift;

    # Default templates for everything else
    $self->renderer->root('/Users/defaul/templates');
}

1;
</code></pre>
As you can see we've chosen a very minimalistic approach that feels in line with the rest of Mojolicious.
Switching between modes is as easy as changing a environment variable.
<pre>
% MOJO_MODE=production bin/my_app daemon
</pre>]]>
        
    </content>
</entry>

<entry>
    <title>Mojo review</title>
    <link rel="alternate" type="text/html" href="http://labs.kraih.com/blog/2008/11/mojo-review.html" />
    <id>tag:labs.kraih.com,2008:/blog//1.19</id>

    <published>2008-11-07T17:29:02Z</published>
    <updated>2009-03-11T17:36:38Z</updated>

    <summary>Mark Stosberg just reviewed Mojo, take a look!...</summary>
    <author>
        <name>Sebastian</name>
        
    </author>
    
        <category term="Perl" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en-US" xml:base="http://labs.kraih.com/blog/">
        <![CDATA[<a href="http://mark.stosberg.com">Mark Stosberg</a> just <a href="http://mark.stosberg.com/blog/2008/11/review-of-mojo-087-a-new-perl-web-framework.html">reviewed</a> Mojo, take a look!]]>
        
    </content>
</entry>

<entry>
    <title>Mojo and HTTP::Engine</title>
    <link rel="alternate" type="text/html" href="http://labs.kraih.com/blog/2008/11/mojo-vs-httpengine.html" />
    <id>tag:labs.kraih.com,2008:/blog//1.18</id>

    <published>2008-11-07T14:31:01Z</published>
    <updated>2009-03-11T17:36:48Z</updated>

    <summary>Update: This benchmark was in fact not very fair towards HTTP::Engine, since i&apos;ve exploited a design flaw. The reason was that i wanted to make a point and show how useless this kind of benchmark is. :) Kazuhiro Osawa did...</summary>
    <author>
        <name>Sebastian</name>
        
    </author>
    
        <category term="Perl" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en-US" xml:base="http://labs.kraih.com/blog/">
        <![CDATA[<b>Update:</b> This benchmark was in fact not very fair towards HTTP::Engine, since i've exploited a design flaw.
The reason was that i wanted to make a point and show how useless this kind of benchmark is. :)<br /><br />

<a href="http://yappo.jp">Kazuhiro Osawa</a> did a quite interesting <a href="http://blog.yappo.jp/yappo/archives/000617.html">benchmark</a> comparing Mojo and HTTP::Engine performance.
What he forgot to mention was that the HTTP::Engine backend he used was a minimal server that barely understands HTTP 1.0, while the Mojo server had full HTTP 1.1 support.<br /><br />

Now i thought activating some more features in HTTP::Engine like keep-alive would make this benchmark way more interesting.<br /><br />
<b>HTTP::Engine code</b>
<pre><code class="perl">
use strict;
use warnings;
use HTTP::Engine;
use HTTP::Engine::Response;

HTTP::Engine->new(
    interface => {
        module          => 'Standalone',
        args => { port => 8081, keepalive => 1, fork => 1 },
        request_handler => sub {
            my $req = shift;
            HTTP::Engine::Response->new(
                body => 'Congratulations, your Mojo is working!',
            );
        },
    }
)->run;
</code></pre>
<b>Mojo code</b>
<pre><code class="perl">
use strict;
use warnings;
use Mojo::Server::Daemon::Prefork;

my $daemon = Mojo::Server::Daemon::Prefork->new;
$daemon->port(8082);
$daemon->run;
</code></pre>
<b>HTTP::Engine result</b>
<pre>
Macintosh:~ sri$ ab -n 10000 -c 100 http://127.0.0.1:8081/
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking 127.0.0.1 (be patient)
Completed 1000 requests
Completed 2000 requests
Completed 3000 requests
Completed 4000 requests
Completed 5000 requests
Completed 6000 requests
Completed 7000 requests
Completed 8000 requests
Completed 9000 requests
Completed 10000 requests
Finished 10000 requests


Server Software:        
Server Hostname:        127.0.0.1
Server Port:            8081

Document Path:          /
Document Length:        38 bytes

Concurrency Level:      100
Time taken for tests:   282.980 seconds
Complete requests:      10000
Failed requests:        0
Write errors:           0
Total transferred:      1710000 bytes
HTML transferred:       380000 bytes
Requests per second:    35.34 [#/sec] (mean)
Time per request:       2829.797 [ms] (mean)
Time per request:       28.298 [ms] (mean, across all concurrent requests)
Transfer rate:          5.90 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   1.0      0      23
Processing:    84 2816 178.0   2830    3066
Waiting:       84 2813 178.0   2827    3061
Total:         89 2816 177.7   2830    3066

Percentage of the requests served within a certain time (ms)
  50%   2830
  66%   2860
  75%   2878
  80%   2889
  90%   2917
  95%   2940
  98%   2970
  99%   2993
 100%   3066 (longest request)
</pre>
<b>Mojo result</b>
<pre>
Macintosh:~ sri$ ab -n 10000 -c 100 http://127.0.0.1:8082/
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking 127.0.0.1 (be patient)
Completed 1000 requests
Completed 2000 requests
Completed 3000 requests
Completed 4000 requests
Completed 5000 requests
Completed 6000 requests
Completed 7000 requests
Completed 8000 requests
Completed 9000 requests
Completed 10000 requests
Finished 10000 requests


Server Software:        
Server Hostname:        127.0.0.1
Server Port:            8082

Document Path:          /
Document Length:        38 bytes

Concurrency Level:      100
Time taken for tests:   15.234 seconds
Complete requests:      10000
Failed requests:        0
Write errors:           0
Total transferred:      1591431 bytes
HTML transferred:       380342 bytes
Requests per second:    656.41 [#/sec] (mean)
Time per request:       152.344 [ms] (mean)
Time per request:       1.523 [ms] (mean, across all concurrent requests)
Transfer rate:          102.01 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0   40  28.2     39     128
Processing:     3  111  37.2    114     358
Waiting:        1   80  32.0     81     294
Total:         10  151  33.3    152     365

Percentage of the requests served within a certain time (ms)
  50%    152
  66%    157
  75%    163
  80%    168
  90%    192
  95%    211
  98%    231
  99%    249
 100%    365 (longest request)
</pre>
Note that none of the HTTP::Engine backends comes (not even remotely) close to the number of features present in Mojo, so take these benchmarks with a grain of salt, even though Mojo destroyed HTTP::Engine. Maybe once they add at least one backend that speaks HTTP 1.1 we can have a real benchmark.]]>
        
    </content>
</entry>

<entry>
    <title>Want Mojo documentation?</title>
    <link rel="alternate" type="text/html" href="http://labs.kraih.com/blog/2008/11/want-mojo-documentation.html" />
    <id>tag:labs.kraih.com,2008:/blog//1.17</id>

    <published>2008-11-05T15:25:26Z</published>
    <updated>2009-03-11T17:36:59Z</updated>

    <summary>I&apos;ve submitted a grant proposal to the Perl Foundation, you can leave a comment there to show them your interest, every comment counts!...</summary>
    <author>
        <name>Sebastian</name>
        
    </author>
    
        <category term="Perl" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en-US" xml:base="http://labs.kraih.com/blog/">
        <![CDATA[I've submitted a <a href="http://news.perlfoundation.org/2008/11/2008q4_grant_proposal_the_mojo.html">grant proposal</a> to the Perl Foundation, you can leave a comment there to show them your interest, every comment counts!]]>
        
    </content>
</entry>

<entry>
    <title>Mojo website launched!</title>
    <link rel="alternate" type="text/html" href="http://labs.kraih.com/blog/2008/11/mojo-website-launched.html" />
    <id>tag:labs.kraih.com,2008:/blog//1.16</id>

    <published>2008-11-03T12:52:58Z</published>
    <updated>2009-03-11T17:37:10Z</updated>

    <summary> What is a web framework without a pretty website? Today we have finally launched http://mojolicious.org, yay! Lets see if we can start a new trend of good looking Perl sites. :)...</summary>
    <author>
        <name>Sebastian</name>
        
    </author>
    
        <category term="Perl" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en-US" xml:base="http://labs.kraih.com/blog/">
        <![CDATA[<a href="http://mojolicious.org"><img src="http://kraih.com/mojolicious-screenshot.jpg"></a>
What is a web framework without a pretty website?
Today we have finally launched <a href="http://mojolicious.org">http://mojolicious.org</a>, yay!
Lets see if we can start a new trend of good looking Perl sites. :)]]>
        
    </content>
</entry>

<entry>
    <title>Mojo 0.8 released (full Windows compatibility)</title>
    <link rel="alternate" type="text/html" href="http://labs.kraih.com/blog/2008/11/mojo-08-released-full-windows-compatibility.html" />
    <id>tag:labs.kraih.com,2008:/blog//1.15</id>

    <published>2008-11-03T12:49:47Z</published>
    <updated>2009-03-11T17:38:16Z</updated>

    <summary>Today is a great day for Mojo, the last big milestone has been reached, we are now 100% Windows compatible. Kudos to all who have helped! And here is the complete changelog. - Fixed Mojo::Server::Daemon windows support. - Generated applications...</summary>
    <author>
        <name>Sebastian</name>
        
    </author>
    
        <category term="Perl" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en-US" xml:base="http://labs.kraih.com/blog/">
        <![CDATA[Today is a great day for Mojo, the last big milestone has been reached, we are now 100% Windows compatible.
Kudos to all who have helped!
And here is the complete changelog.
<blockquote>
        - Fixed Mojo::Server::Daemon windows support.<br />
        - Generated applications now have individually named executables.<br />
        - Cleaned up Mojo::Home.<br />
        - Changed Mojolicious default application templates to something more
          sane.<br />
        - Mojo::Base accessors don't take multiple arguments anymore,
          this results in a 25% speed increase.<br />
        - Added MOJO_MAX_MEMORY_SIZE environment variable.<br />
        - Added prepare_parser and prepare_builder callbacks to
          Mojo::Message.<br />
        - Added done and is_done to Mojo::Stateful.<br />
        - Fixed many win32 related bugs.<br />
        - Fixed keep alive related bugs in daemon and client. (Pedro Melo)<br />
        - Allow default in Mojo::Base to have false values. (Pedro Melo)<br />
        - Fixed chmod_rel_file in Mojo::Script. (Shu Cho).<br />
        - Mojo::Base attributes can't start with a digit. (Shu Cho).<br />
        - Fixed Content-Length header for empty messages.<br />
        - Removed warning from Mojo.pm.<br />
        - Renamed gate to bridge in MojoX::Routes.<br />
        - Added waypoint() to MojoX::Routes.<br />
        - Added named url_for to MojoX::Routes and Mojolicious.<br />
        - Added Mojolicious documentation. (vti)<br />
        - Fixed documentation links.<br />
        - Fixed some typos.<br />
</blockquote>]]>
        
    </content>
</entry>

</feed>
