Change JsonFactory.builder()
configuration of RecyclerPool
to avoid allocation default implementation (in 3.0)
#1269
Labels
3.x
Issues to be only tackled for Jackson 3.x, not 2.x
Currently
JsonFactoryBuilder
takes directlyRecyclerPool<BufferRecycler>
for configuration (as wellJsonFactory
) in 2.x; and the default implementation is eagerly assigned. For the case where this is changed, we allocate default implementation only to discard it.This is necessary since 2.x does not actually have real builder (only facade over
JsonFactory
).But for 3.0 we can change things to leave pool for builder to be
null
, which is only changed to default implementation when one is actually needed. This avoids unnecessary allocation.Alternatively if this didn't work we could also consider
Provider
style configuration (which would have other benefits with serializability); but only do that ifnull
doesn't work.The text was updated successfully, but these errors were encountered: