Skip to content

Deserializing maps and sets #405

Open
@sjakobi

Description

@sjakobi

binary, cereal and store all deserialize Sets, IntSets, Maps and IntMaps 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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions