Skip to content

Instantly share code, notes, and snippets.

Created August 9, 2014 19:11
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/cb8c71e24eede4110ae9 to your computer and use it in GitHub Desktop.
Save anonymous/cb8c71e24eede4110ae9 to your computer and use it in GitHub Desktop.
$ perl -Ilib -MTime::HiRes=time -Mojo -E 'helper bar => sub { "works!" }; my $c = app->build_controller; my $before = time; $c->bar for 1 .. 100000; say time - $before'
0.838340044021606
$ perl -Ilib -MTime::HiRes=time -Mojo -E 'helper bar => sub { "works!" }; helper foo => sub { shift }; my $c = app->build_controller; my $before = time; $c->foo->bar for 1 .. 100000; say time - $before'
1.64256691932678
$ perl -Ilib -MTime::HiRes=time -Mojo -E 'helper "foo.bar" => sub { "works!" }; my $c = app->build_controller; my $before = time; $c->foo->bar for 1 .. 100000; say time - $before'
2.4735221862793
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment