in reply to Re: The Cost of Nested Referencing
in thread The Cost of Nested Referencing
can be a little hard on the eyes. I'm certainly not advocating that everyone use refs when working with HoH's. The main point of the post was that going deep gets slow quick and that I'm suprised that in certain cases, it isn't optimized away. Perl seems to do everything else for me so I was suprised.foreach my $k ( sort { $self->{state}{inputs}{expected}->{$a} <=> $ +self->{state}{inputs}{expected}->{$b} } keys %{ $self->{state}{inputs +}{expected} } ){ # do stuff }
%hash =( headers=>{data}, data=>{ "huge hash" } ); One such instance was a quick and dirty search tool. It was a HoH with a huge amount of entries. If by using a simple assignment, I can get a 15% speed up when iterating through large data sets, I think it's worth doing.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: The Cost of Nested Referencing
by Abigail-II (Bishop) on Nov 15, 2002 at 14:46 UTC |