For the record I had to lower the time given to my GA to find an answer to 43ms (from the time I get the last input to the time I print my commands in stdout), if I tried to go higher than that I had increasingly frequent timeouts.
The fact that the time limit I set is linked with the amount of timeouts makes me think that in my case, timeouts weren’t caused by an exception thrown, but buy actually taking longer than 50ms to reply.
I don’t know if that can help, but I added debug to try and understand the cause of the timeouts, and everytime, I know that I had written in stdout the command for all the ships but the last one when the timeout occured.
I find it unlikely that the timeout would always occur exactly at the last printf, never before. Maybe there was something wrong with my code/the referee’s code in these situations.
44ms / turn.
I don’t have 100% test coverage so can’t claim my code is bug free, but I’m quite confident in that my timeouts weren’t caused by crashes.
That said, considering stats like “reCurse : 0/ 966”, I’m guessing there’s something we were doing wrong.
My code rely on 45 ± some small part of code not included to this time.
I actually thinking that it can be also related to garbage collector.
Also during one contest I saw some correlation between how big output to Stderr. I have some timeouts, but when I remove Stderr output - they are gone.
I use a timer of 40ms too. But i’m not 100% sure that my code is bug free. I can’t say if my 2 crashes during the rerun are real timeout or just big crashes.