commercetools/commercetools-sdk-java-v2

Performance degradation issue that happens on API Root init due to Default object mapper instantiation.

okyzym opened this issue · 3 comments

okyzym commented

could you please take a look at this line

https://github.com/commercetools/commercetools-sdk-java-v2/blame/a6e9a5f4840cc050d9240de1bff64ffb0d1675f1/rmf/rmf-java-base/src/main/java/io/vrap/rmf/base/client/ClientBuilder.java#L143

it leads to the default serialiser instantiation notwithstanding the custom serialiser can be passed to api builder. It leads to extra resources consuming

ResponseSerializer serializer = ResponseSerializer.of(); <--- creates ObjectMapper instance
this.serializer = () -> serializer;

perhaps it would be better to change it to

this.serializer = () -> ResponseSerializer.of();

okyzym commented

ApiRootBuilder.of().withSerializer(myCustomSerialiser)..

True that. We will change it.

Fixed with 16.0.0