Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 79ae8b6eb3
Fetching contributors…

Cannot retrieve contributors at this time

19 lines (11 sloc) 0.31 kb
#!/usr/bin/perl
# compare pack() to the x operator for whitespace
use Benchmark;
my $COUNT = 5_000_000;
my $blanks_25 = ' ' x 25;
timethese( $COUNT, {
'x' => sub { $x = ' ' x 25; },
'pack' => sub { $x = pack( 'A25', '' ); },
'assign' => sub { $x = $blanks_25; },
}
);
Jump to Line
Something went wrong with that request. Please try again.