in reply to Re^4: Efficiency: Recursive functions while de-subbing my program
in thread Efficiency: Recursive functions while de-subbing my program

The final outcome of that thread was to demonstrate that you don't even understand the difference between micro-optimizations and real optimizations. Which you demonstrate some more here.

So, whilst in the OPs target case, subroutine overhead is a red-herring, dismissing it completely as peanuts is a bad message in the wider scheme of things.

I didn't dismiss the sub overhead completely as peanuts. I concurred with dismissing the very specific case of 100k subroutine calls as peanuts (and then commented on how silly your "OMG! 400% faster, wow!" demonstration was).

Even if File::Find weren't accessing the file system, the idea of just eliminating subroutine call overhead would still be silly. The subroutines of File::Find aren't even close to as trivially tiny as they would need to be for removing subroutine calls to have a chance of being worthwhile.

Your own benchmark even makes that easy to see. You show that doing one useless thing (an addition) is 4 times faster than doing several useless things (an addition, a subroutine call, a 'my' declaration, copying a passed-in value, returning a copy of that value).

- tye        

  • Comment on Re^5: Efficiency: Recursive functions while de-subbing my program (arithmetic)

Replies are listed 'Best First'.
Re^6: Efficiency: Recursive functions while de-subbing my program (arithmetic)
by BrowserUk (Patriarch) on Jul 14, 2013 at 08:46 UTC