Re:Java BitSet performance-flicker mystery
by cospaia on Saturday February 05, 2022 @06:22PM
(#30227412)
Yes, I should try to profile each run and compare the profiles of the bad and good ones.
Would be quite funny if it's in the System.currentTimeMillis() call this happens. I'd try to figure out a way to remove that from the picture...
Re:Java BitSet performance-flicker mystery
by oldsecondhand on Saturday February 05, 2022 @09:08PM
(#30228568)
I'm not familiar with Java profiling. What's the alternative?
Re:Java BitSet performance-flicker mystery
by cospaia on Sunday February 06, 2022 @04:26AM
(#30230817)
I've now made an experiment that removes System.currentTimeMillis() as a suspect: https://github.com/PEZ/ghost-chase-condition/tree/master/tes...
I'm not experienced with doing micro-optimisations in Java, but I assume you can profile it to find out which individual operations are taking up the time just via a sampling trace.
Given it's common on a particular OS setup, I wouldn't be surprised if it's in the System.currentTimeMillis() call that you're doing every loop.