FasterXML / jackson-dataformats-binary

Uber-project for standard Jackson binary format backends: avro, cbor, ion, protobuf, smile
Apache License 2.0
310 stars 133 forks source link

Refactor Smile format module use of `ThreadLocal` to be bound to `SmileFactory` #393

Closed cowtowncoder closed 1 year ago

cowtowncoder commented 1 year ago

Currently Smile format module uses ThreadLocal for buffer recycling, both for parser and generators. Although eventually it'd be good to make this pluggable, similar to work in jackson-core, it makes sense to start by refactoring to unify handling so it's driven by SmileFactory and not by parser/generator classes.

cowtowncoder commented 1 year ago

Ok, implemented. One less ThreadLocal, things bit more isolated. But the next step is trickier, need to think it through -- ideally jackson-cores BufferRecycler and BufferRecyclerPool could be used somehow but we'll see how that works.