Ambrosia

 view release on metacpan or  search on metacpan

benchmark/Ambrosia/core/ClassFactory.b  view on Meta::CPAN

#!/usr/bin/perl
use strict;
use warnings;
use lib qw(lib t);

use Benchmark;

use Ambrosia::core::ClassFactory;

my $i = 0;
timethese(50_000, {
        'create'    => sub {
            Ambrosia::core::ClassFactory::create('Employes::Person::' . $i++, {public => [qw/FirstName LastName Age/]});
        },
});

timethese(500_000, {
        'create_object'    => sub {
            Ambrosia::core::ClassFactory::create_object('Person', (FirstName => 'John', LastName => 'Smith', Age => 33));
        },
});



( run in 0.889 second using v1.01-cache-2.11-cpan-5a3173703d6 )