chaokunyang commented on code in PR #1701:
URL: https://github.com/apache/fury/pull/1701#discussion_r1677012984


##########
java/fury-core/src/main/java/org/apache/fury/Fury.java:
##########
@@ -1220,6 +1239,43 @@ public Object 
deserializeJavaObjectAndClass(FuryReadableChannel channel) {
     return deserializeJavaObjectAndClass(buf);
   }
 
+  @Override
+  public <T> T copy(T obj) {
+    if (obj == null) {
+      return null;
+    }
+    copyDepth++;
+    try {
+      return (T) 
classResolver.getOrUpdateClassInfo(obj.getClass()).getSerializer().copy(obj);

Review Comment:
   Would be better to use a switch here to create a fastpath for common types, 
which can avoid the virtual method call cost



-- 
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]

Reply via email to