Closed megawac closed 9 years ago
Got some unexpected results on other distanceN functions :
http://jsperf.com/mathp-manhattandistancen http://jsperf.com/mathp-minkowskidistancen http://jsperf.com/mathp-euclideandistancen
They'll stay with their single exit point for the moment
The perf will change again when you change binding (insert issue here) On Dec 21, 2014 7:17 AM, "Kevin Chapelier" notifications@github.com wrote:
Got some unexpected results on other distanceN functions :
http://jsperf.com/mathp-manhattandistancen http://jsperf.com/mathp-minkowskidistancen http://jsperf.com/mathp-euclideandistancen
They'll stay with their single exit point for the moment
— Reply to this email directly or view it on GitHub https://github.com/kchapelier/node-mathp/pull/8#issuecomment-67768598.
Thanks for your contributions, do you mind if I credit you as a contributor in the package.json ?
On a more related note : http://jsperf.com/chebyshevdistancen
newImplementationVariant is basically the same as your implementation but with a single exit point.
I usually try to avoid multiple exit points in functions, butthe performance trade off of the multiple exit points is good (±9%). I'll apply the same change on other distanceN functions.