-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
make callback function takes original data array #94
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but can I just request that you run benchmarks before and after to make sure the performance isn't affected by these changes?
I'm thinking it's slower to apply a callback function in every step of the loop as opposed to executing an expression, but I might be wrong.
I'm aware that this library needs browser benchmarks and benchmarks without BLAS enabled, but for now you can change benchmarks/vector.js
to include ../vector
instead of ../vectorious
.
Hope this isn't too much trouble! I'm grateful for your interest in improving this library.
Here is the benchmark result for this PR
|
This is the bench mark for master
|
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map
Make each, map, reduce methods take callback function similar to the one in js Array.