Conversation
Merging this PR will not alter performance
Comparing Footnotes
|
b98d0bc to
b6d2fb5
Compare
cef8430 to
5dc11d9
Compare
| } | ||
| } | ||
|
|
||
| map.shrink_to_fit(); |
There was a problem hiding this comment.
does shrink_to_fit reallocate?
There was a problem hiding this comment.
depending on allocator? But just once.
There was a problem hiding this comment.
I wonder if we can avoid reallocation and add something like:
debug_assert!(
map.capacity() <= map.len().next_power_of_two(),
"HashMap capacity {} exceeds next power of two {} for length {}",
map.capacity(),
map.len().next_power_of_two(),
map.len(),
);There was a problem hiding this comment.
It would be nice to have some check that we weren't over allocating, if there is a possibility tzdata could shrink.
| let mut map = HashMap::new(); | ||
| fn build_tz_abbrev_map() -> AHashMap<String, String> { | ||
| // todo: optimiza initial size from actual data | ||
| let mut map = AHashMap::with_capacity_and_hasher(1024, Default::default()); |
There was a problem hiding this comment.
move the magic number to TZ_ABBREV_CACHE_SIZE_HINT and document how it was determined?
There was a problem hiding this comment.
document how it was determined
I can't because I don't know how to determine it.
|
2 test are good. But 2 test are bad:
|
Closes #10702 as not planned.