Created
March 20, 2012 16:37
-
-
Save wchristian/2138007 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use strictures; | |
package moose_perf; | |
use 5.010; | |
use Git::PurePerl::Object::Tree; | |
use Git::PurePerl::DirectoryEntry; | |
use Time::HiRes 'time'; | |
run(); | |
exit; | |
sub run { | |
my $git = bless {}, "Git::PurePerl"; | |
my @trees; | |
say "preparing"; | |
for my $i ( 0 .. 20 ) { | |
my $tree = Git::PurePerl::Object::Tree->new( | |
content => "", | |
git => $git, | |
sha1 => "", | |
size => 0, | |
); | |
my @entries = map Git::PurePerl::DirectoryEntry->new( filename => $_, git => $git, mode => 0, sha1 => "" ), | |
0 .. 1600; | |
$tree->directory_entries( \@entries ); | |
push @trees, $tree; | |
} | |
say "destroying"; | |
while ( @trees ) { | |
my $thing = pop @trees; | |
my $start = time; | |
undef $thing; | |
my $end = time; | |
say sprintf "%04d %.3f", scalar @trees, ( $end - $start ); | |
} | |
return; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment