taoensso / nippy

The fastest serialization library for Clojure
https://www.taoensso.com/nippy
Eclipse Public License 1.0
1.04k stars 60 forks source link

Perf+size optimization for numbers #36

Closed ptaoussanis closed 10 years ago

ptaoussanis commented 10 years ago

A byte-sized long-typed number is currently serialized as a long (8 bytes). It should be relatively simple to optimize away these kinds of cases so that we're always storing a minimal amount of data.

There are a couple ways of doing this, and I'd like it to be simple to extend to custom types - so going to take a little time to think about it.

Update: Actually it occurs to me now that if this trick could be applied to all internal integers (incl. encoded data structure sizes), it could make a significant difference indeed.

ptaoussanis commented 10 years ago

Closing, addressed in an upcoming release.