News for hackers. Stuff that matters.
Re:Java BitSet performance-flicker mystery by Arcuru on Saturday February 05, 2022 @06:12PM (#30227321)
Do you have performance traces of good and bad runs to compare? Instead of trying to come up with more theories you should start by looking at where the time is being spent.

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.

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...
Re:Java BitSet performance-flicker mystery by dehrmann on Saturday February 05, 2022 @08:26PM (#30228315)
> System.currentTimeMillis() is pretty platform-dependent, so it's a good place to look