Thanks very much for the summary.

It is very interesting that assignFromArray is much faster than indexedArray. Can anyone explain why?

On 05/30/2014 05:42 PM, Jon Norberg wrote:
There have been several posts about this, so I tried to compile what I could find to compare speed and pretty coding:

http://nbviewer.ipython.org/urls/dl.dropboxusercontent.com/u/38371278/Function%20parms%20passing%20speed%20test.ipynb

Best speed is assigning values or variables inside the function
Second best is reassigning parameters from array for each parameter. The @pack/@unpack macro also is pretty fast and much prettier Third best is separate parameters and global assignment (longer function call code if many parameters or/and just no no to use global?) Slowest is using indexed array as parameters in function (but this is ugly to read) and immutable types

So I am wondering, did I miss any that improve speed/prettiness?

Best, Jon




Reply via email to