Skip to content

Change JsonFactory.builder() configuration of RecyclerPool to avoid allocation default implementation (in 3.0) #1269

@cowtowncoder

Description

@cowtowncoder

Currently JsonFactoryBuilder takes directly RecyclerPool<BufferRecycler> for configuration (as well JsonFactory) 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 if null doesn't work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.xIssues to be only tackled for Jackson 3.x, not 2.x

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions