Created
June 3, 2014 08:36
-
-
Save hisaichi5518/cdb319ae0df2ac08b848 to your computer and use it in GitHub Desktop.
data validator role benchmark
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 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