use strict;
use warnings;
$| = 1;
my $size = 2e6;
my $data =
[ 'AGCTCGTTGTTCGATCCA', 'GAGAGATAGATGATAGTG', 'TTTT_CCCC', 0 ];
print "begin\n";
my %barcode_hash = map { $_ => $data } 1 .. $size;
print "end\n";
####
...
our %barcode_hash = map { $_ => $data } 1 .. $size;
...
##
##
use strict;
use warnings;
use Time::HiRes 'time';
my $start_time = time;
system(@ARGV) == 0 or die "\"@ARGV\" failed with error: $?";
printf "%0.03f seconds\n", time - $start_time;
##
##
perl timeit.pl perl test.pl
my %big_hash: 2.726 seconds
our %big_hash: 1.351 seconds