tommyettinger commented on issue #1409: URL: https://github.com/apache/incubator-fury/issues/1409#issuecomment-2002402887
I was able to run the benchmark, and I may have an avenue that could improve contains() and get() performance.  This was testing just contains() with Object keys, some of which were `Class` instances from `java.**` packages, and some of which were simple `Dummy` instances, where Dummy is a class that stores its name and that's it, using identity comparison like Class. The one case where anything performed noticeably better was when hashing the .toString() result of the Object (but .getName() on Class would also work), and I believe that only did well because the String and its hashCode are cached. That didn't do better every time, and some other operations took longer. The full benchmark data on various operations is available here as a raw .txt: https://github.com/tommyettinger/assorted-benchmarks/blob/529bd6a8e48ceb3fbbb7f0021f990394e1fd3cf6/jmh/Identity_Map_21.txt and here as a nicely-formatted spreadsheet (.fods format from LibreOffice and I think OpenOffice): (direct link) https://github.com/tommyettinger/assorted-benchmarks/raw/2538fcf164e27b3defc368436f8e2799225f75e9/jmh/Identity_Map_Performance_21.fods The confusing thing is that there seems to be some deoptimization going on in the JVM, since the benchmarks each start about twice as fast as when they actually start recording data. It could be my laptop heating up quickly, but that seems unlikely. You can run the benchmarks yourself by loading the `jmh` project in [the repo I linked](https://github.com/tommyettinger/assorted-benchmarks/tree/master/jmh) and running the shadowJar task. Then you can use a command like... ``` java -jar benchmarks.jar "JDKIdentityMapBench" -p impl=JDK_O2O_HASH,JDK_O2O_IDENTITY,JDKGDXDS_HASH,JDKGDXDS_TOSTR,JDKGDXDS_IDENTITY -p size=100,1000,10000 -wi 4 -i 5 -f 1 -w 5 -r 5 -p payloadType=OBJECT_UNIFORM ``` ... which will run the Class-and-Dummy-Object test with the implementations for HashMap, IdentityHashMap, ObjectObjectMap, the new ObjectMapToString, and IdentityObjectMap, on sizes 100, 1000, and 10000, with 4 warmup iterations, 5 actual iterations, and each iteration taking 5 seconds. My apologies for how messy the benchmarking project is... It's mostly a testbed to see if something is worth investigating further. -- 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]
