Skip to content

Poor performance in Protobuf map deserialization #2332

@ricmf

Description

@ricmf

I'm running some benchmarks serializing objects to a RocksDB and deserializing them back. Deserialization is taking much longer than serialization. I profiled the program with jvisualvm and it seems the majority of CPU is spent on hashcode calls. On line 216 the lib deserializes the map entries into a linkedhashset, which for some reason takes the most CPU time in hashcode calls. Could this be replaced by a List deserializer since on the next line it everything is put into a map? If there are repeated MapEntry elements then their keys must be equal so associateBy would do the same.

profile

val setOfEntries = LinkedHashSetSerializer(mapEntrySerial).merge(this, oldSet)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions