Skip to content

Commit

Permalink
More efficient handling of different discriminator types (#771)
Browse files Browse the repository at this point in the history
* Remove redundant de-aliasing of the discriminator field name

* Fix code duplication

* Remove handling of impossible -2 value for discriminator

* Remove redundant wrapping into `RecordingReader`

* Fix reported trace for error when parsing discriminator field value

* Speed up scanning for the discriminator field

* Remove support of more than 1 discriminator fields in JSON encoders

* Speed up encoding of non-simple enums

* Yet more efficient decoding of non-simple enums

* Lesser allocations and hash map lookups when parsing enums

* Use StringMatrix for enum decoding to reduce allocations and CPU usage

* Avoid dynamic caching of JSON decoders based on a position of the discriminator field in parsed messages

* Avoid negations of flags in the field parsing loop

* Reorder the duplication check for less branch mis-predictions

* Remove redundant negations and checks

* Remove redundant checks for case classes with the discriminator field

* Reduce accesses to the Lexer module references and the decoder cache in decode methods

* Reformat
  • Loading branch information
plokhotnyuk authored Jan 8, 2025
1 parent c49b7bf commit 5694f0d
Show file tree
Hide file tree
Showing 2 changed files with 284 additions and 239 deletions.
Loading

0 comments on commit 5694f0d

Please sign in to comment.