Deserializing maps and sets
- 主要语言
- Haskell
- 星标
- 355
- 派生
- 194
- 平均合并
- 3 天 4 小时
- 30 天内合并 PR
- 4
描述
`binary`, `cereal` and `store` all deserialize `Set`s, `IntSet`s, `Map`s and `IntMap`s via `fromDistinctAscList <$> deserializeList` or even `fromList <$> deserializeList` and I've been wondering if that's the best way to do it.
The problem seems to be that this will first completely build the intermediary list before the map or set is constructed from the list.
Instead, it seems to me that the set or map should be built by repeatedly inserting a single element.
Do you agree that this should save a lot of memory allocations?
What I think is missing from `containers` to support the alternative deserialization implementations is something like a `insertDistinctMax` function that can efficiently insert an element that is known to be strictly greater than all elements in the set/map.
贡献指南
评估
这个 Issue 还没有评估数据。