Neiko2002 opened a new issue, #1537: URL: https://github.com/apache/incubator-fury/issues/1537
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/incubator-fury/issues) and found no similar issues. ### Version Version: 0.5.0-SNAPSHOT OS: Windows JDK: 22 ### Component(s) Java ### Minimal reproduce step ``` public static void main(String[] args) throws Exception { final byte[] data = new byte[406991872]; int runs = 5; Fury fury = Fury.builder().withLanguage(Language.JAVA) .withRefTracking(false) .requireClassRegistration(true) .withNumberCompressed(false) .withStringCompressed(false) .build(); { try (Output output = new Output(Files.newOutputStream(furyFile), 1024*1024)) { fury.serializeJavaObject(output, data); } long start = System.currentTimeMillis(); for (int i = 0; i < runs; i++) { try (Output output = new Output(Files.newOutputStream(furyFile), 1024*1024)) { fury.serializeJavaObject(output, data); // warmup } } System.out.println("serializeJavaObject took "+(System.currentTimeMillis()-start)+"ms"); } { try (Output output = new Output(Files.newOutputStream(furyFile), 1024*1024)) { fury.serialize(output, data); // warmup } long start = System.currentTimeMillis(); for (int i = 0; i < runs; i++) { try (Output output = new Output(Files.newOutputStream(furyFile), 1024*1024)) { fury.serialize(output, data); } } System.out.println("serialize took "+(System.currentTimeMillis()-start)+"ms"); } } ``` ### What did you expect to see? I would expect the serializeJavaObject(...) runs a little bit slower because of the additional class information which need to be stored, but the method is actually faster than serialize(...). In this example its only 10% difference. For a more complex project we get 25% faster serialization times for serializeJavaObject(...) than serialize(...) ### What did you see instead? ``` 18:26:27.900 [main] INFO org.apache.fury.Fury -- Created new fury org.apache.fury.Fury@52aa2946 serializeJavaObject took 7352ms serialize took 7849ms ``` ### Anything Else? This is not a perfect benchmark (no JMH), but no matter how many additional runs we add to the test or if we change the execution order the results are always the same. ### Are you willing to submit a PR? - [ ] I'm willing to submit a PR! -- 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]
