This repository was archived by the owner on Feb 22, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 248
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Closed
Example of differences between MicroMap and HashMap due to Iterables:
MicroMap - fine
MicroMap - 1 |
@rkirov Can you squash all of the SHAs into a single SHA. |
…ay and after a number of elements is inserted switches to a HashMap implementation. MicroMap is intended to be used when one expects that the number of elements will be quite low. In this setting it's better to use an array and use linear search to locate elements rather then using the actual HashMap. After a certain number of elements have been inserted HashMap will perform better then array and linear search. Worst case scenario will be when the number of elements keeps oscillating around threshold value which will cause the map to keep switching from array to HashMap (and vice versa). Switching form array to hashMap and the other way around is an expensive operation. Closes dart-archive#1201
Null keys are acceptable for HashMap, so MicroMap needs to keep that feature. Also now it stays in delegate mode once it has been switched.
MicroIterators were not conforming to iterator interface. Replaced by simply promoting micromap to Map in iterator getters.
We could not find a performance improvement here. Closing |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Rebased on top of #1208 (original micro map) and #1178 (view perf improvements).
tree benchmark (with dart2js):
pr 1178 (baseline) - 470ms +/- 12%, 42.6 Mb heap
this PR - 450ms +/- 12%, 41.8 Mb heap
The confidence intervals are quite large so I am not sure if this is indeed better or we are looking into noise. Also, running the benchmark for extended period seems to affect the numbers significantly (as some point I saw the baseline drop to 430ms itself).
More work needs to be done on the iterators (they should be views into the micromaps, instead of holding their own values).
(profile-baseline)

(profile-pr)

(baseline heap)

(micromap heap)
