add an easy benchmark harness
[gitmo/Class-MOP.git] / bench / lib / Bench / Construct.pm
CommitLineData
b07c7a9d 1#!/usr/bin/perl
2
3package Bench::Construct;
4use Moose;
5
6has class => (
7 isa => "Str",
8 is => "ro",
9);
10
11has args => (
12 isa => "ArrayRef",
13 is => "ro",
14 auto_deref => 1,
15);
16
17sub code {
18 my $self = shift;
19
20 my $class = $self->class;
21 my @args = $self->args;
22
23 sub { my $obj = $class->new( @args ) }
24}
25
26__PACKAGE__;
27
28__END__