Faster(1.5 - 34 times) Array.unique speed. #1084

wants to merge 3 commits into


None yet
2 participants

arian commented Dec 19, 2011

You're storing the values in an object, with the values as keys. Doing that will call valueOf() of each value. When the values are strings or numbers it's ok, however with other objects this probably won't work.

Also could you provide some

cainrus commented Dec 20, 2011

Updated. Tests:
Please check it. Do we need sugar or speed in core code? Need a framework for micro optimizations?


arian commented Dec 20, 2011

Very nice, however the cases I tried to explain, still don't work, see with your code and with the current code.

Faster is better, but what's more important is readability and API. Especially with these JS functions, which are usually not the bottleneck in your application (compared to DOM stuff).

cainrus commented Dec 20, 2011


@cainrus cainrus closed this Dec 20, 2011


arian commented Dec 20, 2011

Thanks for your effort though, much appreciated! If you see other possible improvements, please let us know :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment