commercetools / commercetools-sdk-java-v2

The e-commerce SDK from commercetools for Java.
https://commercetools.github.io/commercetools-sdk-java-v2/javadoc/index.html
Apache License 2.0
34 stars 15 forks source link

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

Closed okyzym closed 1 year ago

okyzym commented 1 year ago

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 1 year ago

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

jenschude commented 1 year ago

True that. We will change it.

jenschude commented 1 year ago

Fixed with 16.0.0