-
Notifications
You must be signed in to change notification settings - Fork 183
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
Add litemap crate (TupleVecMap) #496
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.
For bonus points in the future, you can see if there's a threshold of the size under which it's faster to just iterate over the elements instead of binary search. For Clojure's array-map, it's apparently 9, and then it auto-upgrades itself to a BTreeMap-esque Map (HAMT).
Notice: the branch changed across the force-push!
~ Your Friendly Jira-GitHub PR Checker Bot |
Notice: the branch changed across the force-push!
~ Your Friendly Jira-GitHub PR Checker Bot |
Pull Request Test Coverage Report for Build 040c69ba2da56a7a79fec9f291bc5081b7b4e63b-PR-496
💛 - Coveralls |
Codecov Report
@@ Coverage Diff @@
## master #496 +/- ##
=======================================
Coverage 73.35% 73.36%
=======================================
Files 117 118 +1
Lines 6501 6502 +1
=======================================
+ Hits 4769 4770 +1
Misses 1732 1732
Continue to review full report at Codecov.
|
Added doctests. Are there specific places folks want me to use this? Also, I haven't added a requirement that all keys be Another potential performance win is splitting the vectors into two for cache reasons, but I don't think it will matter unless |
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!
utils/terrain/Cargo.toml
Outdated
# (online at: https://github.com/unicode-org/icu4x/blob/master/LICENSE ). | ||
|
||
[package] | ||
name = "terrain" |
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.
I have a small to moderate preference for using a functional name like "sorted_vec_map"
, only because "terrain"
isn't really that good of a name for what we're building.
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.
Two things:
- You need to run
cargo fmt
- Let's decide the name of the crate in the meeting tomorrow
Why does CI fail on Cargo.lock changes? |
CC @gregtatum @echeran: can you see what's going on with Cargo.lock? |
Notice: the branch changed across the force-push!
~ Your Friendly Jira-GitHub PR Checker Bot |
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!
Please, file a follow up to add serde support.
Will do once this merges -- @echeran know what to do about the Cargo.lock issues in the tests? |
Notice: the branch changed across the force-push!
~ Your Friendly Jira-GitHub PR Checker Bot |
Wait, no, that fixed itself somehow |
Needs final r+ to merge |
Fixes #484
Somewhat WIP: I want to add doctests and use it in icu4x itself.
This is currently in tree, eventually I think this should be maintained out-of-tree as a general purpose utility, but for now I didn't want to figure that out and it should be fine here.
@zbraniecki: I'm not super happy with the name, I picked it as a kind of ironic "haha, it's a flat map" thing, but I couldn't think of great names. I would have likedmercator
since it's a map projection, but that's taken, and the obviousvec-map
is too. Unsure if the type itself should be calledFlattenedMap
or something, andFlatMap
has another connotation.