in reply to On optimizing nested loops
That's Interesting. Does using grep show any significant improvement over just swapping the order of the foreach loops in your first filter?
I wonder if using each will have any impact? I'll have to give it a go and see.
So maybe something like this?
while (my ($field,$value) = each %{$where}) { @in = grep { $_->{$field} eq $value } @in; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: On optimizing nested loops
by FloydATC (Deacon) on Oct 20, 2014 at 06:58 UTC | |
by tobyink (Canon) on Oct 21, 2014 at 18:42 UTC | |
by FloydATC (Deacon) on Oct 22, 2014 at 20:21 UTC |