in reply to About Data Structure and elaboration time
in thread Apparently strange beahavior that blocks at Filehandle reading

Instead of dereferencing the entire multilevel structure each time, if you create an array of references to the scalars you are incrementing, then you can iterate over that array and increment the values in the nested hash in 1/6th the time:

#! perl -slw use strict; use Time::HiRes qw[ time ]; my %DB_STATS; $DB_STATS{ COMB }{ $_ } = { Rit=>0, Usc=>0 } for 1 .. 18e5; my $start = time; ++$DB_STATS{ COMB }{ $_ }{Rit} for 1 .. 18e5; printf "Full deref took %.3f seconds\n", time() - $start; my @Rits; $Rits[ $_ ] = \$DB_STATS{ COMB }{ $_ }{Rit} for 1 .. 18e5; $start = time; ++$$_ for @Rits; printf "AoR via alias took %.3f seconds\n", time() - $start; print $DB_STATS{COMB}{1}{Rit}; __END__ C:\test>910049 Full deref took 1.511 seconds AoR via alias took 0.247 seconds 2

Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.