Skip to content

Instantly share code, notes, and snippets.

@hisaichi5518
Created June 3, 2014 08:36
Show Gist options
  • Save hisaichi5518/cdb319ae0df2ac08b848 to your computer and use it in GitHub Desktop.
Save hisaichi5518/cdb319ae0df2ac08b848 to your computer and use it in GitHub Desktop.
data validator role benchmark
use 5.10.1;
use strict;
use warnings;
use Benchmark qw(:all);
package Applyed {
use Mouse;
extends "Data::Validator";
with "Data::Validator::Role::Croak";
};
cmpthese(-1, {
apply_now => sub {
Data::Validator->new(test => "Str")->with("Croak");
},
applied => sub {
Applyed->new(test => "Str");
},
});
__END__
Rate apply_now applied
apply_now 13953/s -- -86%
applied 101494/s 627% --
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment