Author Topic: No fix for ghost collisions with planet eaters necissary  (Read 11263 times)

Offline Botsareus

  • Society makes it all backwards - there is a good reason for that
  • Bot God
  • *****
  • Posts: 4483
    • View Profile
No fix for ghost collisions with planet eaters necissary
« on: November 06, 2013, 04:19:10 PM »
Due to the fact that vegys are massive, I no longer see the need to restrict robot collisions where they spring past each other, in most cases the robot settle on the vegys and no weird erratic behavior is observed.

I did however notice a 50% decrease in speed vs running the same simulation on 2.45.01. Probebly due to the whole new chloroplast system. Nothing I can really do about that except maybe get an AMD Bulldozer for my laptop, not happening though, I even dk if my laptop supports it.

Offline Peter

  • Bot God
  • *****
  • Posts: 1177
    • View Profile
Re: No fix for ghost collisions with planet eaters necissary
« Reply #1 on: December 30, 2013, 06:01:06 PM »
You got a (new) amd laptop?
Oh my god, who the hell cares.

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Re: No fix for ghost collisions with planet eaters necissary
« Reply #2 on: December 30, 2013, 10:18:38 PM »
It's probably worth running the program in a profiler and make certain what's actually causing it to run slowly.  Often you'd be surprised by what's taking longer or what's not taking any time at all.  Even with years of experience writing performance critical code I still get my ass handed to me by weird functions that I didn't think would ever bubble up to the top of a performance capture.

Offline Botsareus

  • Society makes it all backwards - there is a good reason for that
  • Bot God
  • *****
  • Posts: 4483
    • View Profile
Re: No fix for ghost collisions with planet eaters necissary
« Reply #3 on: January 01, 2014, 10:15:53 AM »
 :blink: I am a little scared actually putting this thing in to sleepy profiler, Due to the sh*t load of code in this program I am afraid it will take me like a month to go trough it all.

Maybe if I have some time later on my tower once I get everything else going on my laptop

That being said,

What am I supposed to look for Numsgil? All I will get back is % of how much each section of code executed. Will I have to compare it vs how 2.45 runs, and start drilling down deeper into the code in places where it looks like it is taking longer then it should?
« Last Edit: January 01, 2014, 10:23:08 AM by Botsareus »

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Re: No fix for ghost collisions with planet eaters necissary
« Reply #4 on: January 01, 2014, 02:10:49 PM »
It's not % each section is called, it's % each section is taking up in the overall execution time.

See if you can find a tree view for the performance details.  That tells you callstacks, which is useful if all the time is in a vector add method and you need to know what's calling it.

Usually there's like 90% of the program running time in like 10% of the code.  Identifying what's running slow is the first step in fixing it.  Maybe it's something that's easy to fix.  Maybe it's something that's hard.  Either way, you won't know if you don't look.

Yes, profilers are a bit scary to figure out, but if I could figure out how to use a version of VTune from 8 years ago to profile Darwinbots you can use a profiler too.

Offline Botsareus

  • Society makes it all backwards - there is a good reason for that
  • Bot God
  • *****
  • Posts: 4483
    • View Profile
Re: No fix for ghost collisions with planet eaters necissary
« Reply #5 on: January 02, 2014, 10:12:05 AM »
Ok man, I will try it.

Offline Botsareus

  • Society makes it all backwards - there is a good reason for that
  • Bot God
  • *****
  • Posts: 4483
    • View Profile
Re: No fix for ghost collisions with planet eaters necissary
« Reply #6 on: January 24, 2014, 02:19:38 PM »
Did not find anything that jumped out at me. There was small variation but that is probably due to cpu hits being different. I was very surprised how little the new vegy code had on the system as long as video was off.

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Re: No fix for ghost collisions with planet eaters necissary
« Reply #7 on: January 25, 2014, 01:45:07 AM »
Where is most of the time going then?

Offline Botsareus

  • Society makes it all backwards - there is a good reason for that
  • Bot God
  • *****
  • Posts: 4483
    • View Profile
Re: No fix for ghost collisions with planet eaters necissary
« Reply #8 on: January 25, 2014, 11:50:57 AM »
There was a large change with video on...

Offline Botsareus

  • Society makes it all backwards - there is a good reason for that
  • Bot God
  • *****
  • Posts: 4483
    • View Profile
Re: No fix for ghost collisions with planet eaters necissary
« Reply #9 on: January 25, 2014, 12:22:09 PM »
Here Numsgil, maybe you can dig up something in this data that I missed.  :)

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Re: No fix for ghost collisions with planet eaters necissary
« Reply #10 on: January 25, 2014, 02:23:58 PM »
The timings look weird to me.

Make sure you're starting the simulation up and then starting the capture.  There's a lot of time in the capture from what looks like the application starting up and you starting a new simulation.  You probably don't want to be capturing that.

I'll play with it more later tonight if I have time.

Offline Botsareus

  • Society makes it all backwards - there is a good reason for that
  • Bot God
  • *****
  • Posts: 4483
    • View Profile
Re: No fix for ghost collisions with planet eaters necissary
« Reply #11 on: January 25, 2014, 02:49:34 PM »
Actually I started both runs after starting a sim and disabling video. However, I only captured for one hour and my cpu is not top notch.

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Re: No fix for ghost collisions with planet eaters necissary
« Reply #12 on: January 25, 2014, 05:38:14 PM »
You usually don't need more than 10-20 seconds of capture.  You're just looking for trends.

Anyway, I was able to take a capture of it with good data.  Looks like Robots::UpdateRobots takes about 80% of the time.  Which makes sense since pretty much everything goes through that.

37% is taken up by Buckets_Module::CompareRobots3.  Half of that is in Common::VectorMagnitude.  The symbols don't point to the source code I have on disk (they point to your J:/... drive path), so I can't find where in that all the time is going.

I'm attaching the capture.  Play around with it inside Sleepy until you feel comfortable figuring out how I got those numbers.  Profiling is a skill worth having if you're starting a career as a programmer.

In terms of making it faster, you could probably cache a lot of the calculations going on in CompareRobots3.  It's basically calculating how far a robot can see from scratch for every robot-robot vision check.  It would also be worthwhile to double check that the bucket system is still working.  If that was broken it would be difficult to detect other than that the program would be slower.

Offline Botsareus

  • Society makes it all backwards - there is a good reason for that
  • Bot God
  • *****
  • Posts: 4483
    • View Profile
Re: No fix for ghost collisions with planet eaters necissary
« Reply #13 on: January 25, 2014, 07:00:18 PM »
Quote
In terms of making it faster, you could probably cache a lot of the calculations going on in CompareRobots3.  It's basically calculating how far a robot can see from scratch for every robot-robot vision check.  It would also be worthwhile to double check that the bucket system is still working.  If that was broken it would be difficult to detect other than that the program would be slower.

I will windiff the source for CompareRobots3 and Bot bucket system, though I am pretty sure I have not even touched these.
I will also take a look at your capture.



Quote
The symbols don't point to the source code I have on disk

No wonder I could not figure out anything, I forgot that it uses the actual source code.
« Last Edit: January 25, 2014, 07:09:04 PM by Botsareus »

Offline Botsareus

  • Society makes it all backwards - there is a good reason for that
  • Bot God
  • *****
  • Posts: 4483
    • View Profile
Re: No fix for ghost collisions with planet eaters necissary
« Reply #14 on: January 25, 2014, 07:14:03 PM »
Ok, the only difference is the eye strength mod for pondmode. But I think that is still faster then calculating shadow lines. If pondmode is off it is x1.
Anyway, thank you for your help. I think I am confident enough to move on.
« Last Edit: January 25, 2014, 07:18:33 PM by Botsareus »