4 ms·
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
by Arcuru 5y ago
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.
- cospaia 5y agoYes, 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...
- oldsecondhand 5y agoI'm not familiar with Java profiling. What's the alternative?
- deleted 5y ago[deleted]
- deleted 5y ago[deleted]
- dehrmann 5y ago> System.currentTimeMillis() is pretty platform-dependent, so it's a good place to look
- cospaia 5y agoI've now made an experiment that removes System.currentTimeMillis() as a suspect: https://github.com/PEZ/ghost-chase-condition/tree/master/test-runs/timed-passes-10K https://github.com/PEZ/ghost-chase-condition/tree/master/tes...