You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 30, 2023. It is now read-only.
ObjectMapper is fairly expensive to create, and especially for Android, this can create quite the heavy pressure on the GC and memory usage, considering it is created on every socket message.
Therefore I kindly suggest to either:
Delegate the instance construction to the BinanceApiWebSocketListener class constructor so we can allow more flexibility in creating ObjectMapper.
And maybe create the ObjectMapper instance if it wasn't given and hold it locally as a private reference in a secondary constructor. This can maintain the current library compatibility.
The same issue also present in UserDataUpdateEventDeserializer
public <T> TgetUserDataUpdateEventDetail(Stringjson, Class<T> clazz) {
ObjectMappermapper = newObjectMapper();
try {
returnmapper.readValue(json, clazz);
} catch (IOExceptione) {
thrownewBinanceApiException(e);
}
}
I can help creating a pull request later to fix this, but if you guys have any other idea or other implementations in mind, then please feel free to share.
The text was updated successfully, but these errors were encountered:
Related code:
binance-java-api/src/main/java/com/binance/api/client/impl/BinanceApiWebSocketListener.java
Lines 26 to 35 in 74289e4
ObjectMapper
is fairly expensive to create, and especially for Android, this can create quite the heavy pressure on the GC and memory usage, considering it is created on every socket message.Therefore I kindly suggest to either:
BinanceApiWebSocketListener
class constructor so we can allow more flexibility in creatingObjectMapper
.ObjectMapper
instance if it wasn't given and hold it locally as a private reference in a secondary constructor. This can maintain the current library compatibility.The same issue also present in
UserDataUpdateEventDeserializer
binance-java-api/src/main/java/com/binance/api/client/domain/event/UserDataUpdateEventDeserializer.java
Lines 45 to 52 in 74289e4
I can help creating a pull request later to fix this, but if you guys have any other idea or other implementations in mind, then please feel free to share.
The text was updated successfully, but these errors were encountered: