Skip to content

Instantly share code, notes, and snippets.

@tobyink
Created November 11, 2013 16:52
Show Gist options
  • Save tobyink/7416390 to your computer and use it in GitHub Desktop.
Save tobyink/7416390 to your computer and use it in GitHub Desktop.
use strict;
use warnings;
use Benchmark qw(cmpthese);
#use Mouse;
use Types::Standard qw(Int);
our $type = Int;
our $check = $type->compiled_check;
cmpthese(-1, {
'$type' => q{ $::type->check($_) for 0..100 },
'$check' => q{ $::check->($_) for 0..100 },
});
__END__
With Mouse loaded:
Rate $type $check
$type 3381/s -- -81%
$check 17935/s 430% --
Without Mouse loaded:
Rate $type $check
$type 1487/s -- -61%
$check 3765/s 153% --
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment