Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.



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...


I'm not familiar with Java profiling. What's the alternative?


I've now made an experiment that removes System.currentTimeMillis() as a suspect: https://github.com/PEZ/ghost-chase-condition/tree/master/tes...


> System.currentTimeMillis() is pretty platform-dependent, so it's a good place to look




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: