magro / kryo-serializers

More kryo serializers
Apache License 2.0
381 stars 120 forks source link

Use writeVarInt for enum ordinals #95

Closed shevek closed 5 years ago

shevek commented 6 years ago

In things like EnumMapSerializer, VarInt encoding is smaller than int encoding for both lengths and ordinal() values. Please prefer it.

magro commented 5 years ago

Which serializer are you referring to? Do you want to submit a PR?

shevek commented 5 years ago

https://github.com/magro/kryo-serializers/blob/master/src/main/java/de/javakaffee/kryoserializers/EnumMapSerializer.java#L96

Should use writeVarInt() to save 3 bytes.

magro commented 5 years ago

Right. As said, feel free to submit a PR!