Open romain-grecourt opened 4 years ago
@romain-grecourt could you please elaborate a bit, this issue is quite old and I am not sure it is still relevant. Thanks
This is about avoiding the creation of new operator instances for every invocation to readers()
and writers()
. I.e Use a list field and initialize it on the first call to readers()
and writers()
.
DefaultMediaSupport
can be improved:
readers()
or writers()
is invokedDefaultMediaSupport.create
can use a LazyValue
for the defaultMultiPartSupport.create()
can use a LazyValue
for the defaultUsing LazyValue
with create()
methods is odd, but it's a decent optimization as the operators are stateless. This pattern is implemented by JacksonSupport
, JsonbSupport
and JsonpSupport
. We should update the javadoc to state that it's get or create
rather than just create
.
The code below should be implemented lazily for all
MediaSupport
implementations: