rasn
rasn copied to clipboard
Optimize field presence tracking of default/optional/extended fields
This assumes that #323 is merged first.
Field count of Sequence/Set is possible to know in compile-time and this will make such a change. Because of that, it possible to use map with correct size in stack without any heap allocations.
It will increase performance quite a bit: (the screenshot is against alloc PR branch)
There is also untested scenario, which causes bug with HashMap (surprise...), this also adds test for that. It will probably apply for PER too.
Further optimization likely requires creating own data structure and improve the logic of field_bitfield
usage. For some reason it still adds more overhead than it should.
If this seems good, I can make the change for PER too.