The real solution would be common subexpression optimization, which is significantly more difficult.Even more than most people think. Not only is it a bit of a pain to do, and somwehat time consuming, but it potentially alters the semantics of the program. If a hash is tied, caching the return from exists, if exists returns a ref, changes a two-tie-hit to a one-tie-hit. While this may not necessarily be a bad thing, it is definitely a change in behaviour.
In reply to Re: Re: optimization - exists should return a reference
by Elian
in thread optimization - exists should return a reference
by John M. Dlugosz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |