You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@fory.apache.org by "chaokunyang (via GitHub)" <gi...@apache.org> on 2025/12/13 12:50:39 UTC
Re: [PR] feat(java): add config params for IdentityObjectIntMap [fory]
chaokunyang commented on code in PR #3048:
URL: https://github.com/apache/fory/pull/3048#discussion_r2616290147
##########
java/fory-core/src/main/java/org/apache/fory/resolver/MapRefResolver.java:
##########
@@ -52,15 +52,16 @@ public final class MapRefResolver implements RefResolver {
private long writeTotalObjectSize = 0;
private long readCounter;
private long readTotalObjectSize = 0;
- private final IdentityObjectIntMap<Object> writtenObjects =
- new IdentityObjectIntMap<>(DEFAULT_MAP_CAPACITY, 0.51f);
+ private final IdentityObjectIntMap<Object> writtenObjects;
private final ObjectArray readObjects = new ObjectArray(DEFAULT_ARRAY_CAPACITY);
private final IntArray readRefIds = new IntArray(DEFAULT_ARRAY_CAPACITY);
// last read object which is not a reference
private Object readObject;
- public MapRefResolver() {}
+ public MapRefResolver(int size, float loadFactor) {
+ writtenObjects = new IdentityObjectIntMap<>(size, loadFactor);
Review Comment:
I think the size in unnecessary, after the resize, it never shrink
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@fory.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fory.apache.org
For additional commands, e-mail: commits-help@fory.apache.org