chaokunyang commented on code in PR #1722:
URL: https://github.com/apache/fury/pull/1722#discussion_r1754288483
##########
java/fury-core/src/main/java/org/apache/fury/serializer/collection/AbstractMapSerializer.java:
##########
@@ -140,6 +147,378 @@ protected final void writeElements(Fury fury,
MemoryBuffer buffer, Map map) {
}
}
+ protected final void chunkWriteElements(Fury fury, MemoryBuffer buffer, Map
map) {
+ Serializer keySerializer = this.keySerializer;
+ Serializer valueSerializer = this.valueSerializer;
+ // clear the elemSerializer to avoid conflict if the nested
+ // serialization has collection field.
+ // TODO use generics for compatible serializer.
+ this.keySerializer = null;
+ this.valueSerializer = null;
+ if (keySerializer != null && valueSerializer != null) {
+ javaChunkWriteWithKVSerializers(buffer, map, keySerializer,
valueSerializer);
+ } else if (keySerializer != null) {
+ javaChunkWriteWithKeySerializers(map, buffer, keySerializer);
+ } else if (valueSerializer != null) {
+ javaChunkWriteWithValueSerializers(map, buffer, valueSerializer);
+ } else {
+ genericJavaChunkWrite(fury, buffer, map);
+ }
+ }
+
+ private void javaChunkWriteWithKeySerializers(
Review Comment:
this method is too gig, jvm jit can't inline such big method, could we split
it into multiple smaller methods? especially for less frequent code path?
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]