johnzon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Romain Manni-Bucau <rmannibu...@gmail.com>
Subject Re: optimisations with buffer initialisation
Date Wed, 26 Jun 2019 10:00:02 GMT
+1

Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://rmannibucau.metawerx.net/> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<https://www.packtpub.com/application-development/java-ee-8-high-performance>


Le mer. 26 juin 2019 à 11:49, Mark Struberg <struberg@yahoo.de.invalid> a
écrit :

> 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 =
>
> BufferStrategyFactory.valueOf(System.getProperty("johnzon.global-char-provider.strategy",
> "QUEUE"))
>
> .newCharProvider(Integer.getInteger("org.apache.johnzon.default-char-provider.length",
> 1024));
>
>     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, bufferProvider);
>
> 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?
>
> LieGrue,
> strub
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message