Skip to content

Instantly share code, notes, and snippets.

Created August 11, 2014 15:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/0de87d1408f5e98707a1 to your computer and use it in GitHub Desktop.
Save anonymous/0de87d1408f5e98707a1 to your computer and use it in GitHub Desktop.
$ perl -Mojo -E 'sub Mojolicious::Controller::bar { "works!" }; my $c = app->build_controller; n { $c->bar } 100000'
0.0179179 wallclock secs ( 0.02 usr + 0.00 sys = 0.02 CPU) @ 5000000.00/s (n=100000)
$ perl -Mojo -E 'helper bar => sub { "works!" }; my $c = app->build_controller; n { $c->bar } 100000'
0.866315 wallclock secs ( 0.87 usr + 0.00 sys = 0.87 CPU) @ 114942.53/s (n=100000)
$ perl -Mojo -E 'helper foo => sub { shift }; helper bar => sub { "works!" }; my $c = app->build_controller; n { $c->foo->bar } 100000'
1.6739 wallclock secs ( 1.67 usr + 0.00 sys = 1.67 CPU) @ 59880.24/s (n=100000)
$ perl -Mojo -E 'helper "foo.bar" => sub { "works!" }; my $c = app->build_controller; n { $c->foo->bar } 100000'
1.79191 wallclock secs ( 1.80 usr + 0.00 sys = 1.80 CPU) @ 55555.56/s (n=100000)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment