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

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.
  • Comment on RE: RE: RE: RE: always in quest to eliminate temporary variables

Replies are listed 'Best First'.
RE: RE: RE: RE: RE: always in quest to eliminate temporary variables
by merlyn (Sage) on Jun 17, 2000 at 01:53 UTC
    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