Can someone show me a test that will prove that passing references to a subroutine is better/faster than passing around the data itself? I haven't hit upon a good test that shows passing references is faster.
While you've been given many excellent answers so far, none of them seem to really address the assumptions in the question :) Passing references isn't better/faster than passing the data around because perl aliases whatever you've passed in to be in @_. It's the act of copying the data that will cause an extra speed/memory hit. So make sure you don't ask perl to make a copy. :-)
In reply to Re: Show that using references is faster
by duff
in thread Show that using references is faster
by Keystroke
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |