Thread history
Viewing a history listing
Time | User | Activity | Comment |
---|---|---|---|
21:38, 17 October 2017 | Beaming (talk | contribs) | New reply created | (Reply to cpuConstant) |
21:03, 17 October 2017 | MultiplyByZer0 (talk | contribs) | New reply created | (Reply to cpuConstant) |
15:03, 17 October 2017 | Beaming (talk | contribs) | New reply created | (Reply to cpuConstant) |
04:47, 17 October 2017 | Xor (talk | contribs) | New reply created | (Reply to cpuConstant) |
04:47, 17 October 2017 | Xor (talk | contribs) | New reply created | (Reply to cpuConstant) |
04:34, 17 October 2017 | Beaming (talk | contribs) | New reply created | (Reply to cpuConstant) |
04:05, 17 October 2017 | Xor (talk | contribs) | New reply created | (Reply to cpuConstant) |
03:46, 17 October 2017 | Beaming (talk | contribs) | New reply created | (Reply to cpuConstant) |
03:40, 17 October 2017 | Xor (talk | contribs) | New reply created | (Reply to cpuConstant) |
03:37, 17 October 2017 | Beaming (talk | contribs) | New thread created |
Hi all, I decided to work on my skipped turns and to watch my execution time. As the first step, I recalculated cpuConstant according to cpuManager code (I wish it would be available from within the robot) at the beginning of each round. Guess what. The number wildly fluctuate. By wildly, we are talkin more than FOUR times!!! On the short end of the spectrum cpuConstant is about 8mS and it can be as large as 35mS.
Any ideas what is going on? Everything is done with openjdk8. One difference from the original code: I measure time with System.nanoTime()
Yes with Turbo Boost, CPU speed is not constant ;) And I think every new CPU should have something like that.
I would expect the cpuConstant go lower as turbo kicks in. But my first run usually gives lower number (faster speed), and consequent executions typically but not always are longer/slower.
In either case it is a problem. Recall recently discussed ThreadDeath issue.
Do you relay highly on GC? I mean do you create objects in loops? If the speed gets slower, I can only guess that would be GC.
Well, I do have many HashMaps and several kdTrees but the fact that Java kicks in with GC at random times is certainly an issue. The init round should be relatively low CPU event on my bot part.
Strange part is that robocode does not report 37 mS long execution as a skipped turn while my "official" cpuConstant is about 6mS.
Robocode gives robots extra time at the beginning of a round. In addition, most of this time is probably taken away by one-time setup and initialization code, making your calculated CPU constant longer than it should be.