This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Copyright (C) 2008-2010, Sebastian Riedel. | |
| package Lighter::Controller; | |
| use strict; | |
| use warnings; | |
| use base 'Mojo::Base'; | |
| use Mojo::ByteStream; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 1,3c1 | |
| < # Copyright (C) 2008-2010, Sebastian Riedel. | |
| < | |
| < package Mojolicious; | |
| --- | |
| > package Lighter; | |
| 8c6 | |
| < use base 'Mojo'; | |
| --- | |
| > use base 'Mojo::Base'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 1,3c1 | |
| < # Copyright (C) 2008-2010, Sebastian Riedel. | |
| < | |
| < package Mojolicious; | |
| --- | |
| > package Lighter; | |
| 8c6 | |
| < use base 'Mojo'; | |
| --- | |
| > use base 'Mojo::Base'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/lib/Mojo/Base.pm b/lib/Mojo/Base.pm | |
| index 47302aa..d0cb014 100644 | |
| --- a/lib/Mojo/Base.pm | |
| +++ b/lib/Mojo/Base.pm | |
| @@ -8,6 +8,8 @@ use warnings; | |
| # No imports because we get subclassed, a lot! | |
| require Carp; | |
| +use constant DEBUG => $ENV{MOJO_BASE_DEBUG} ? 1 : 0; | |
| + |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/perl | |
| package test; | |
| use strict; | |
| use warnings; | |
| sub new { bless {}, shift } | |
| package main; | |
| use strict; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Benchmark: timing 100000 iterations of Eval, Normal... | |
| Eval: 7 wallclock secs ( 6.53 usr + 0.29 sys = 6.82 CPU) @ 14662.76/s (n=100000) | |
| Normal: 2 wallclock secs ( 1.27 usr + 0.11 sys = 1.38 CPU) @ 72463.77/s (n=100000) | |
| Benchmark: timing 10000000 iterations of Eval, Normal... | |
| Eval: 22 wallclock secs (21.30 usr + 0.00 sys = 21.30 CPU) @ 469483.57/s (n=10000000) | |
| Normal: 22 wallclock secs (21.67 usr + 0.00 sys = 21.67 CPU) @ 461467.47/s (n=10000000) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Rate Eval Normal | |
| Eval 16835/s -- -82% | |
| Normal 93458/s 455% -- | |
| Rate Normal Eval | |
| Normal 581395/s -- -12% | |
| Eval 662691/s 14% -- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env perl | |
| # Copyright (C) 2008-2010, Sebastian Riedel. | |
| use strict; | |
| use warnings; | |
| use utf8; | |
| # Disable epoll, kqueue and IPv6 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env perl | |
| use strict; | |
| use warnings; | |
| use utf8; | |
| use Test::More; | |
| plan tests => 4; | |
| use Mojo::Client; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use App; | |
| my $fake_app = App->new; | |
| my $config = $fake_app->plugin(json_config); |