-
Notifications
You must be signed in to change notification settings - Fork 136
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
#219 - Improve Map performance #293
Conversation
First commit only adds a performance unit test that consistently fails IE11 locally (per contributing.md) |
@neenhouse Thanks for working on this, I've triggered a run on CircleCI for this. In order for us to be able to accept your contribution though, we require you to have read and accepted our contributor license agreement. |
Test fails in CI in expected way 👍 |
Took a first pass at the algorithm. Two notes:
I'd like to run a few more tests to compare performance between master + branch. Also want to try at least one algo that does not do the key modification approach and instead uses smaller hash tables that are iterated on to handle those lookups as edge cases. |
Running local Karma unit test in Chrome
So reasonably close performance wise to the native implementation in Chrome. |
Looking great @neenhouse! |
@JakeChampion Think this is ready for 1st review. I improved the marking of objects/functions by introducing randomness to avoid collisions if lib is loaded multiple times and abuse. Using reference comparison based algos even in smaller hash tables eventually leads to the same O(n) perf problem if a particular key type is over-used, so I thought this would be an acceptable trade off (thought also since primitives are usually used as keys in most UIs I've worked on, maybe a moot issue?). |
|
@zloirock Thanks for the feedback. Frozen object keys forced me to climb the ladder of abstraction by 1 rung and were a bit tricky. I don't see a way to avoid O(n) computation time when dealing with those since I'm depending on being able to mark an object key with some kind of meta data to map it back to the internal state of the Map. Do you have any suggestions for dealing with perf in those cases? Appreciate any additional feedback. @JakeChampion - I saw for |
@neenhouse see |
Thanks for the feedback @zloirock |
Will this also fix the perf issues in Set? I'm guessing they have the same root cause. |
Hi @craigkovatch, this only improves
|
Any update on this? We would really like to be able to use Set/Map |
… cannot be used in dot notation in ES3 environments such as ie8
Addresses #219
Only has test plan. Implementation still pending.