in reply to Re: "exists $hash{key}" is slower than "$hash{key}"
in thread "exists $hash{key}" is slower than "$hash{key}"
Thanks for this.
I'm not sure why not being able to access the lexical matters. My objective is simply to isolate code as much as possible so the relative differences are down to the exists/value checks. That said, I used the globals because I hit an issue with incrementing package lexicals in the stringified code when it was run by the benchmark module, but probably just did something incorrect when setting those up.
The effect of the non-existent key is interesting. I'll add it to my benchmarks.
WRT sub calls, there seem to still be overheads that affect the timings (or my benchmarks need more work) - see my response to tobyink at 11111089.
|
|---|