haskell / haskell/containers

Deserializing maps and sets

未关闭
#405 19 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
docs feature-request IntMap IntSet Map performance Set
主要语言
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 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。