Closed hiddentao closed 10 years ago
Ah, just seen my mistake :(
Sorry about that, I'd been playing around with passing arrays today (and had seen some performance improvements by changing the function signature) and so I thought that perhaps there was an opportunity here. Lesson learnt: if it's too good to be true it probably isn't true.
It was a good try. Optimization ends up being educated guessing at some point.
An ~12x speed-up by switching from using an array parameter to a parameter list, still allowing us to pass in an array of values using
.apply()
.As long as we stick to well-known optimization principles regarding the use of the
arguments
array (see this) we should be ok.I'm almost thinking I've done something wrong here, it can't be this much faster! would appreciate your input.