in reply to RE: RE: always in quest to eliminate temporary variables
in thread always in quest to eliminate temporary variables

Since "eliminate temporary variables" is an artificial (read: meaningless) requirement, it can be interpreted in arbitrary ways.

-- Randal L. Schwartz, Perl hacker

  • Comment on RE: RE: RE: always in quest to eliminate temporary variables

Replies are listed 'Best First'.
RE: RE: RE: RE: always in quest to eliminate temporary variables
by Adam (Vicar) on Jun 16, 2000 at 21:30 UTC
    When you say meaningless, do you mean that I was correct in my assumption that temp variables get generated (or not) at the compiler's whim? I know that in C++ compilers temp variables are generated when they are needed and optimized out when they are not. I hope that perl does something similar, which of course eliminates this whole thread, but I don't know.
      I'm saying that until proven, optimizing for "eliminating temporary variables" is likely to be a very pointless optimization. Much more interesting to optimize for minimizing the number of times the data is being copied, or number of opcodes executed, or total memory allocated, or needless actions repeated. "Temporary variables" can either be cheap or expensive, so it's like optimizing to remove the number of vowels in the variable names -- it's a red herring.

      -- Randal L. Schwartz, Perl hacker