rpuch commented on a change in pull request #616:
URL: https://github.com/apache/ignite-3/pull/616#discussion_r798501688



##########
File path: 
modules/network/src/main/java/org/apache/ignite/internal/network/serialization/marshal/MarshallingContext.java
##########
@@ -17,25 +17,24 @@
 
 package org.apache.ignite.internal.network.serialization.marshal;
 
-import static java.util.Collections.unmodifiableSet;
-
-import java.io.DataOutputStream;
+import it.unimi.dsi.fastutil.Hash;
+import it.unimi.dsi.fastutil.ints.IntOpenHashSet;
+import it.unimi.dsi.fastutil.ints.IntSet;
+import it.unimi.dsi.fastutil.objects.Object2IntMap;
+import it.unimi.dsi.fastutil.objects.Object2IntOpenCustomHashMap;
 import java.io.IOException;
 import java.io.NotActiveException;
-import java.util.HashSet;
-import java.util.IdentityHashMap;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import org.apache.ignite.internal.network.serialization.ClassDescriptor;
+import org.apache.ignite.internal.util.io.GridDataOutput;
 
 /**
  * Context using during marshalling of an object graph accessible from a root 
object.
  */
 class MarshallingContext {
-    private final Set<ClassDescriptor> usedDescriptors = new HashSet<>();
+    private final IntSet usedDescriptorIds = new IntOpenHashSet();
 
-    private final Map<Object, Integer> objectsToIds = new IdentityHashMap<>();
+    private final Object2IntMap<Object> objectsToIds = new 
Object2IntOpenCustomHashMap<>(new IdentityHashStrategy());

Review comment:
       First I also was not seeing any difference, but after some 
optimizations, on a medium object (`AllTypesMessage` without arrays) it 
suddenly started to be a little faster.




-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to