johnzon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Struberg <>
Subject optimisations with buffer initialisation
Date Wed, 26 Jun 2019 09:49:28 GMT
hi folks!

we have some potential enhancements in our init routines which could lead to slightly less
resource consumption.

static class JsonProviderDelegate extends JsonProvider {
    private final BufferStrategy.BufferProvider<char[]> bufferProvider =

    private final JsonReaderFactory readerFactory = new JsonReaderFactoryImpl(null);
    private final JsonParserFactory parserFactory = new JsonParserFactoryImpl(null);
    private final JsonGeneratorFactory generatorFactory = new JsonGeneratorFactoryImpl(null);
    private final JsonWriterFactory writerFactory = new JsonWriterFactoryImpl(null);
    private final JsonBuilderFactoryImpl builderFactory = new JsonBuilderFactoryImpl(null,

It seems we create multiple different BufferStragegy instances.
They should essentially all either be lazily created or reuse the same default strategy or
even BufferProvider, isn't?


View raw message