From: Todd Hepler Date: Tue, 15 May 2012 19:45:35 +0000 (-0500) Subject: added Moose with make_immutable X-Git-Tag: 2.0800~74 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo%2FMoose.git;a=commitdiff_plain;h=b918096cd8116f11fdb9668b98189b98181003a0 added Moose with make_immutable it's slower than regular Moose (as expected) --- diff --git a/benchmarks/lotsa-classes.pl b/benchmarks/lotsa-classes.pl index 701cd25..06271ad 100644 --- a/benchmarks/lotsa-classes.pl +++ b/benchmarks/lotsa-classes.pl @@ -20,6 +20,11 @@ my %class_writer = ( my $attrs = join '', map { "has '$_' => ( is => 'ro', isa => 'Str' );\n" } @_; return qq{package $name;\nuse Moose;\n$attrs\n1;\n__END__\n}; }, + 'MooseImmutable' => sub { + my $name = shift; + my $attrs = join '', map { "has '$_' => ( is => 'ro', isa => 'Str' );\n" } @_; + return qq{package $name;\nuse Moose;\n$attrs\n__PACKAGE__->meta->make_immutable;\n1;\n__END__\n}; + }, 'Moo' => sub { my $name = shift; my $attrs = join'', map { "has '$_' => ( is => 'ro', isa => 'Str' );\n" } @_;