Garbage Collection and Skipped Turns

Jump to navigation Jump to search

Java treats an array as an object, so on the heap.

However, these days the JVM is more intelligent than you guys are giving it credit for, eg. it has Escape Analysis to determine if objects should be put on the stack if they stay local.

Skilgannon15:25, 4 April 2013

Didn´t know about escape analysis.

What I usually do to take in account all optimizations, even those I don´t know about, is to use profiling tools. Measure what is really happening, instead of looking at the code and guessing.

MN16:08, 4 April 2013

I've actually been debating writing a Robocode simulator to make robot profiling much easier. What it would do is to pretend to run a robot battle with your robot against either another opponent, or perhaps some imaginary robot, using a combination of mock objects and simulation. It would run without any security at all, no sandbox, nor would their be skipped turns, so you would only want to run it with trusted robots. But it would be much easier to run a profiler against. The simulated battle may not be a perfect simulation, but as long as it's close, it should work and be useful.

Skotty22:06, 5 April 2013
 

When I do profiling in Robocode, I run a battle of a bot against itself. Then I filter the results by package so engine data is filtered out and only data from my bots appear in the profiling report.

MN00:10, 6 April 2013

What profiling tool do you use? I haven't tried that many, but I've been rather unsuccessful trying to use profiling tools on Robocode. The last one I tried was Visual VM, but when you try to profile a running instance of Robocode with Visual VM, it prompts for a username and password. I kind of gave up and assumed I would run into similar trouble with all profiling tools, either due to the Robocode security setup or due to the odd way that Robocode loads classes and sandboxes robots. If you know of a profiling tool that works with existing Robocode, please share!

Skotty03:31, 6 April 2013

I tried VisualVM and when it asked for username/pw I just did a/a and it worked, I suspect it asks for them but doesn't actually use them.

Make sure you start robocode with -Ddebug=true so that it disables skipped turns!

Skilgannon11:15, 7 April 2013
 

You do not have permission to edit this page, for the following reasons:

  • The action you have requested is limited to users in the group: Users.
  • You must confirm your email address before editing pages. Please set and validate your email address through your user preferences.

You can view and copy the source of this page.

Return to Thread:Talk:XanderCat/Garbage Collection and Skipped Turns/reply (22).

 

I just use eclipse, but it took so long that I never really did much profiling (with that). Instead, I timed a bunch of candidates for worst cpu usage and printed the times to the console and then focused on those. All of that, until I realized that I was the only bot evaluating 20 points on the secondary waves :-) When I changed that, I think Gilgalad became one of the fastest bots in the top ten.

Some things to optimize: wall smoothing, I think I recall that you used your own algorithm for this. How fast is that? Geometry methods: How efficient are your precise intersection methods?

I assume you already cache your wave data?

what sort of danger function do you use for surfing?

I never really had trouble with gun speed (yet... we'll see what my latest ideas do to that) so I assume you wouldn't either, but you could at least add some code to verify this.

AW21:43, 6 April 2013
 

The last one I used in Robocode was HPROF.

I call the engine directly through the API so GUI stay out of the way.

MN04:38, 7 April 2013