in reply to Show that using references is faster
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. :-)
|
|---|