[patch] Tech Tree Arc Caching

Programmers discuss here anything related to FreeOrion programming. Primarily for the developers to discuss.

Moderator: Committer

Post Reply
Message
Author
Mitten.O
Programmer
Posts: 255
Joined: Sun Apr 06, 2014 4:15 pm

[patch] Tech Tree Arc Caching

#1 Post by Mitten.O »

The fact that Vezzra reported the mad adventure optimization actually reducing his framerate for the tech tree regardless of the zoom level made me suspect it was something to do with the drawing of the arcs. I did toy with them when initially figuring out the buffer based approach. The result of the toying was in fact inefficient since it recreated many small buffers for the arcs every frame. So here is a patch that stores the tech tree arcs in one large buffer and updates it only when necessary.

The performance benefit for me is close to the margin of error of my measurements, but it may be different for others. Regardless, TechTreeWnd.cpp is quite a large file so I think this patch is worth it just for moving the arc drawing logic to a small, focused file.
Attachments

[The extension patch has been deactivated and can no longer be displayed.]

Any code by me in this post is released under GPL 2.0 or later.

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13603
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: [patch] Tech Tree Arc Caching

#2 Post by Geoff the Medio »

Applies, builds, and runs (at least on 7758) OK for me. On the tech tree, showing all techs, zoomed to just close enough to see text, I get 15 FPS, and one step out (so no text) I get 25 FPS (using the integrated GPU in low power mode) or 33 FPS and 52 FPS (using the integrated GPU in balanced power mode).

User avatar
Vezzra
Release Manager, Design
Posts: 6102
Joined: Wed Nov 16, 2011 12:56 pm
Location: Sol III

Re: [patch] Tech Tree Arc Caching

#3 Post by Vezzra »

Builds and runs fine on OSX. Windowed mode, showing all techs, zoomed in so that text is shown: ~60 FPS. Zoomed out so that text isn't shown anymore: ~68 FPS. Graphic card: AMD Radeon HD 6490M.

Mitten.O
Programmer
Posts: 255
Joined: Sun Apr 06, 2014 4:15 pm

Re: [patch] Tech Tree Arc Caching

#4 Post by Mitten.O »

Let this not be forgotten without some thought. Are those numbers higher with the patch? Lower? Same? Opinions on this otherwise?
Any code by me in this post is released under GPL 2.0 or later.

User avatar
Dilvish
AI Lead and Programmer Emeritus
Posts: 4768
Joined: Sat Sep 22, 2012 6:25 pm

Re: [patch] Tech Tree Arc Caching

#5 Post by Dilvish »

The patch shifts my tech tree fps range (for all conditions I checked) upwards by about 3%.
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0

User avatar
Vezzra
Release Manager, Design
Posts: 6102
Joined: Wed Nov 16, 2011 12:56 pm
Location: Sol III

Re: [patch] Tech Tree Arc Caching

#6 Post by Vezzra »

Ripe for commit, I'd say. Anyone any objections?

User avatar
Dilvish
AI Lead and Programmer Emeritus
Posts: 4768
Joined: Sat Sep 22, 2012 6:25 pm

Re: [patch] Tech Tree Arc Caching

#7 Post by Dilvish »

Vezzra wrote:Ripe for commit, I'd say. Anyone any objections?
I agree, no objections. I hesitate to do it myself though, since I wouldn't really know how to add the new file to the MSVC and OSX projects.
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0

User avatar
Vezzra
Release Manager, Design
Posts: 6102
Joined: Wed Nov 16, 2011 12:56 pm
Location: Sol III

Re: [patch] Tech Tree Arc Caching

#8 Post by Vezzra »

As no objections have been raised, I made the necessary updates to the MSVC and Xcode project files and committed the patch.

Post Reply