in reply to Re: "exists $hash{key}" is slower than "$hash{key}"
in thread "exists $hash{key}" is slower than "$hash{key}"
If this is the case then it seems counter intuitive at first glance, and maybe is something that could be modified.
One advantage of using exists $hash{$key} is that the hash values can then all be assigned undef, potentially saving memory. (Although one could also create a scalar ref and re-use it, e.g. my $flag = \1 - this is what is used in Hash::Ordered as a tombstone value.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: "exists $hash{key}" is slower than "$hash{key}"
by LanX (Saint) on Jan 06, 2020 at 01:18 UTC | |
by swl (Prior) on Jan 07, 2020 at 00:52 UTC | |
by LanX (Saint) on Jan 07, 2020 at 01:45 UTC | |
by swl (Prior) on Jan 07, 2020 at 03:15 UTC | |
by dave_the_m (Monsignor) on Jan 07, 2020 at 11:08 UTC | |
|