Skip to content

Instantly share code, notes, and snippets.

@Mons
Created September 25, 2010 11:14
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 Mons/596741 to your computer and use it in GitHub Desktop.
Save Mons/596741 to your computer and use it in GitHub Desktop.
se uni::perl;
use Benchmark ':all';
use lib::abs;
BEGIN {unshift @INC, lib::abs::path 'kraih/lib' }
use Mojo::ByteStream 'b';;
say $INC{'Mojo/ByteStream.pm'};
my %results;
$results{old} = timethis -1 , sub { b('x'x1000) };
delete $INC{'Mojo/ByteStream.pm'};
delete $Mojo::{'ByteStream::'};
shift @INC;
unshift @INC, lib::abs::path 'mons/lib';
require Mojo::ByteStream;
Mojo::ByteStream->import('b');
say $INC{'Mojo/ByteStream.pm'};
$results{new} = timethis -1 , sub { b('x'x1000) };
cmpthese \%results;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment