Skip to content

Instantly share code, notes, and snippets.

Created August 12, 2014 11:19
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/f93e4b96e0cf0082c1ef to your computer and use it in GitHub Desktop.
Save anonymous/f93e4b96e0cf0082c1ef 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 -Ilib -Mojo -E 'helper "foo.bar" => sub { "works!" }; my $c = app->build_controller; n { $c->foo->bar } 100000'
0.989673 wallclock secs ( 0.99 usr + 0.00 sys = 0.99 CPU) @ 101010.10/s (n=100000)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment