Skip to content

Instantly share code, notes, and snippets.

@zigorou
Created April 8, 2010 03:26
Show Gist options
  • Select an option

  • Save zigorou/359742 to your computer and use it in GitHub Desktop.

Select an option

Save zigorou/359742 to your computer and use it in GitHub Desktop.
#!/usr/bin/perl
use strict;
use warnings;
use lib 'lib';
use Benchmark qw(cmpthese);
use Object::Container;
use Object::Container::CAF;
my $orig = Object::Container->instance;
my $caf = Object::Container::CAF->instance;
$orig->register( 'HTML::TreeBuilder::XPath' );
$caf->register( 'HTML::TreeBuilder::XPath' );
cmpthese(
500000 => +{
orig => sub {
$orig->get('HTML::TreeBuilder::XPath');
},
caf => sub {
$caf->get('HTML::TreeBuilder::XPath');
},
},
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment