Thread history

From Talk:ScalarBot/Version History
Viewing a history listing
Jump to navigation Jump to search
Time User Activity Comment
18:38, 30 September 2017 Beaming (talk | contribs) New thread created  
02:24, 1 October 2017 Xor (talk | contribs) New reply created (Reply to Runnable interface)
07:35, 1 October 2017 Xor (talk | contribs) Comment text edited (add)
07:35, 1 October 2017 Xor (talk | contribs) Comment text edited  
15:41, 29 December 2017 Xor (talk | contribs) New reply created (Reply to Runnable interface)
15:42, 29 December 2017 Xor (talk | contribs) Comment text edited (type)

Runnable interface

Hi Xor,

Would you mind to elaborate on "Use Runnable interface instead of onTurnEnded Custom Event to execute(), which is MUCH faster when battle speed set to max"?

Why would it be faster if the code presumably does the same things?

Beaming (talk)18:38, 30 September 2017

Idk ;/ but the test result is obvious — against DoctorBob, ScalarBot 0.01e runs MUCH faster than 0.01f, and the only fundamental difference in 0.01f is the use of onTurnEnded event. The former ends instantly, but the latter takes noticeable time. Idk whether this can be reproduced on different machine, different OS or different java version, but it works on my computer.

Anyway, the use of Runnable (the traditional way) in 0.012k8 makes my APS drop by 0.1 points ;/ further research is on going, I think the only way is to read robocode source code on how runnable is handled.

I guess that for runless bots, robocode will generate a loop for it anyway. But the generated one is way slower for some reason.

Xor (talk)02:24, 1 October 2017

More information:

1. Have had a look at robocode source — when you don't call execute yourself, robocode will call that for you every turn, which is theoretically the same as while(true){execute();}.

2. I call rescan instead of execute to fix some missed scan bugs.

Xor (talk)15:41, 29 December 2017