Author Topic: Profiling Information Regarding The Minimap  (Read 3738 times)

MoLAoS

  • Ornithopter
  • *****
  • Posts: 433
    • View Profile
Profiling Information Regarding The Minimap
« on: 6 April 2013, 15:12:37 »
According to Very Sleepy of the 50% or so CPU time taken up by the ::processFrame function, which itself is 50% of CPU time used, is in the minimap, particularly updateUnitTex. I have never fiddled with the minimap, but perhaps one of the GAE programmers is aware of this issue and why it happens. It seems weird that this function, for something as irrelevant as the minimap, is taking up 25% of CPU time, even after you factor in all the extra stuff that Mandate has in gameplay over GAE.

The more I refine my additional code the larger % of time taken up by the minimap. Its basically 40% of all time according to the profiler. Other significant time is spent mainly on the UI and my new AI. AI is 10%. UI is 10%.

I will probably fiddle around with the minimap code in a couple weeks to see what is up.

I just set the minimap to updateUnitTex every 20 frames instead of 5. Lag disappeared magically. Now minimap is about 10% of total time. And the difference honestly isn't very visible, the minimap is so low res anyways.
« Last Edit: 6 April 2013, 21:36:11 by MoLAoS »

hailstone

  • Local Moderator
  • Battle Machine
  • ********
  • Posts: 1,568
    • View Profile
Re: Profiling Information Regarding The Minimap
« Reply #1 on: 14 April 2013, 06:41:58 »
Nice. On my computer it seems each frame is about 25 milliseconds. So 20 frames is about 500ms which should be good enough for updating the minimap like you mention.
Glest Advanced Engine - Admin/Programmer
https://sourceforge.net/projects/glestae/

MoLAoS

  • Ornithopter
  • *****
  • Posts: 433
    • View Profile
Re: Profiling Information Regarding The Minimap
« Reply #2 on: 14 April 2013, 14:54:17 »
Did your profiling agree that the minimap was an issue?? I didn't check GAE and it was my first time using one. Also do you have any idea how to make the minimap more efficient aside from simply lessening the updates?

I feel kinda meh about doing that, because I feel like the original Glest team was made up of better programmers than me and they had a reason to make the minimap that way.

And did you find anything else that could be slowing the game down in GAE? I feel like my game has a lot of stuff like the AI that takes up time and could hide slowness elsewhere.

silnarm

  • Local Moderator
  • Behemoth
  • ********
  • Posts: 1,373
    • View Profile
Re: Profiling Information Regarding The Minimap
« Reply #3 on: 3 August 2013, 02:16:21 »
I haven't profiled or looked at this since I started poking around in the code again, but I do recall a profiling anomoly from before, namely that PatchMap<> and TypeMap<> getInfluence() methods were showing up in profile output, these were meant to get inlined through template magic, but because I used the curiously recurring template I think it's too confusing for the compiler, removing the base class and duplicating its (limited) functionality should improve things measurably.

  I let you know when I get around to it, or if try it out yourself, do let us know how it goes.
Glest Advanced Engine - Code Monkey

Timeline | Downloads