| 1 | package Bencher::Scenario::Data::Sah::Resolve::Overhead; | ||
| 2 | |||
| 3 | 1 | ▶ | use 5.010001; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 1 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | 1 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | |||
| 7 | 1 | ▶ | use Sah::Schema::perl::distname; # to pull dependency |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 8 | 1 | ▶ | use Sah::Schema::perl::modname; # to pull dependency |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 9 | 1 | ▶ | use Sah::Schema::poseven; # to pull dependency |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 10 | 1 | ▶ | use Sah::Schema::posint; # to pull dependency |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 11 | |||
| 12 | 1 | our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY | |
| 13 | 1 | our $DATE = '2023-01-19'; # DATE | |
| 14 | 1 | our $DIST = 'Bencher-Scenarios-Data-Sah-Resolve'; # DIST | |
| 15 | 1 | our $VERSION = '0.005'; # VERSION | |
| 16 | |||
| 17 | 1 | our $scenario = { | |
| 18 | summary => 'Benchmark the overhead of resolving schemas', | ||
| 19 | modules => { | ||
| 20 | 'Data::Sah' => {}, | ||
| 21 | 'Data::Sah::Normalize' => {}, | ||
| 22 | 'Data::Sah::Resolve' => {}, | ||
| 23 | }, | ||
| 24 | participants => [ | ||
| 25 | { | ||
| 26 | name => 'resolve_schema', | ||
| 27 | perl_cmdline_template => ["-MData::Sah::Resolve=resolve_schema", "-e", 'for (@{ <schemas> }) { resolve_schema($_) }'], | ||
| 28 | }, | ||
| 29 | { | ||
| 30 | name => 'normalize_schema', | ||
| 31 | perl_cmdline_template => ["-MData::Sah::Normalize=normalize_schema", "-e", 'for (@{ <schemas> }) { normalize_schema($_) }'], | ||
| 32 | }, | ||
| 33 | { | ||
| 34 | name => 'gen_validator', | ||
| 35 | perl_cmdline_template => ["-MData::Sah=gen_validator", "-e", 'for (@{ <schemas> }) { gen_validator($_, {return_type=>q(str)}) }'], | ||
| 36 | }, | ||
| 37 | ], | ||
| 38 | |||
| 39 | datasets => [ | ||
| 40 | {name=>"int" , args=>{schemas=>'[q(int)]'}}, | ||
| 41 | {name=>"perl::modname" , args=>{schemas=>'[q(perl::modname)]'}}, | ||
| 42 | {name=>"5-schemas" , args=>{schemas=>'[q(int),q(perl::distname),q(perl::modname),q(posint),q(poseven)]'}}, | ||
| 43 | ], | ||
| 44 | }; | ||
| 45 | |||
| 46 | 1 | 1; | |
| 47 | # ABSTRACT: Benchmark the overhead of resolving schemas | ||
| 48 | |||
| 49 | __END__ | ||