Skip to content

v0.3.0: recursor, lazy loading, integer digit encoding

Choose a tag to compare

@knokko knokko released this 13 Dec 10:58
· 29 commits to master since this release

This release adds several features and fixes:

  • Bitser now uses my Recursor class to 'emulate' recursion, which means that it can go through deep class hierarchies, without causing StackOverflowErrors
  • The SimpleLazyBits class is added, which makes it very easy to lazily deserialize (big) classes without external references, which is nice for improving start-up times
  • Both integers and floats can now have commonValues. If you configure commonValues on an int/float field, these values will take much less storage space (convenient for e.g. 1.0 and 0.0, which tend to appear a lot).
  • Integers can now use an alternative variable-length encoding: digit-based encodings. This is basically the binary equivalent of natural language digits like "420".
  • You can pass a FloatDistributionTracker or IntegerDistribution tracker as withAndOptions in Bitser.serialize. Afterwards, you can call their optimize methods to predict which digit sizes and common values are going to be most effective for your fields.