About freeorion's performance

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

Moderator: Committer

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

Re: About freeorion's performance

#76 Post by Dilvish »

pheldens wrote:I have a feeling theres way more performance improvement possible, please keep at it to the point it runs @60fps on fast computers
If you turn off the 'Limit FPS' setting, you have to quite FO and restart for that to actually come into effect.

If I do that, FO runs pretty steadily around 59 FPS for me, with a 500 star galaxy fully visible, and my computer is at least a couple years old now. So I think we've already met your target. If Geoff can make any more improvements it will really fly.
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
Geoff the Medio
Programming, Design, Admin
Posts: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: About freeorion's performance

#77 Post by Geoff the Medio »

It would be interesting / useful to know if the master version has any noticeable FPS improvement for people who previously had problematically poor rendering performance, in general or on particular screens.

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

Re: About freeorion's performance

#78 Post by Geoff the Medio »

Geoff the Medio wrote:It would be interesting / useful to know if the master version has any noticeable FPS improvement for people who previously had problematically poor rendering performance, in general or on particular screens.
Also for the latest test version, presumably later today.

pheldens
Pupating Mass
Posts: 96
Joined: Fri Mar 15, 2013 12:54 pm

Re: About freeorion's performance

#79 Post by pheldens »

Thanks, performance in

f596343b626761021bc7c944cf1a3bf51f3d5e4b

is excellent, 60 fps everywhere now, not far enough in to test late stage turns

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

Re: About freeorion's performance

#80 Post by Geoff the Medio »

pheldens wrote:...not far enough in to test late stage turns
You could try making a ~1000 star galaxy, with ~20 AIs, high monsters, and then immediately build the Super Tester Takeover. With galaxy gas on.

User avatar
asm64
Space Floater
Posts: 27
Joined: Fri Jan 31, 2014 6:57 am

Re: About freeorion's performance

#81 Post by asm64 »

Hi. I want to tell about GUI performance after last updates. I don't know what is reason of strong slowing - update my Gentoo Linux or update freeorion GIT. I got very slow mouse motion in case I switch to Production window. Also all selections very slow, around 2 seconds at first turn. I think that problem in graphics performance. I have Nvidia with proprietary driver 358.16. Another OpenGL games works fine. This is my current library versions:

Code: Select all

2015-12-06 13:36:34.445186 [debug] Client : Logger initialized
2015-12-06 13:36:34.445616 [debug] Client : v0.4.5+ [build 2015-12-04.eaabf3d] CMake
2015-12-06 13:36:34.445674 [debug] Client : GL Version String: 4.5.0 NVIDIA 358.16
2015-12-06 13:36:34.445750 [debug] Client : Dependency versions from headers:
2015-12-06 13:36:34.445766 [debug] Client : Boost: 1_57
2015-12-06 13:36:34.445785 [debug] Client : FreeType: 2.6.2
2015-12-06 13:36:34.445798 [debug] Client : PNG: 1.6.20+apng
2015-12-06 13:36:34.445811 [debug] Client : Python: 2.7.10
2015-12-06 13:36:34.445824 [debug] Client : SDL: 2.0.3
2015-12-06 13:36:34.445837 [debug] Client : zlib: 1.2.8
2015-12-06 13:36:35.253306 [debug] Client : OpenAL initialized. Version 1.1 ALSOFT 1.16.0Renderer OpenAL SoftVendor OpenAL Community
Extensions: AL_EXT_ALAW AL_EXT_DOUBLE AL_EXT_EXPONENT_DISTANCE AL_EXT_FLOAT32 AL_EXT_IMA4 AL_EXT_LINEAR_DISTANCE AL_EXT_MCFORMATS AL_EXT_MULAW AL_EXT_MULAW_MCFORMATS AL_EXT_OFFSET AL_EXT_source_distance_model AL_LOKI_quadriphonic AL_SOFT_block_alignment AL_SOFT_buffer_samples AL_SOFT_buffer_sub_data AL_SOFT_deferred_updates AL_SOFT_direct_channels AL_SOFT_loop_points AL_SOFT_MSADPCM AL_SOFT_source_latency AL_SOFT_source_length

2015-12-06 13:36:38.702216 [debug] Client : BasesListBox::Populate
2015-12-06 13:36:38.702263 [debug] Client : BasesListBox::PopulateWithSavedDesigns
2015-12-06 13:36:38.712977 [debug] Client : DesignWnd::MainPanel::ReregisterDesigns
2015-12-06 13:36:39.896137 [debug] Client : Limited FPS to 60
2015-12-06 13:36:39.906981 [debug] Client : OpenGL Version Number: 4.5
Next, I checked log file and saw that some functions uses too many time. I check around code and saw next strings:

Code: Select all

    DebugLogger() << "Tech Tree Layout Preparing Tech Data";

    // create a node for every tech
    TechManager& manager = GetTechManager();
    for (TechManager::iterator it = manager.begin(); it != manager.end(); ++it) {
        const Tech* tech = *it;
        if (!tech) continue;
        const std::string& tech_name = tech->Name();
        if (!TechVisible(tech_name, m_categories_shown, m_tech_statuses_shown)) continue;
        m_techs[tech_name] = new TechPanel(tech_name, this);
        m_graph.AddNode(tech_name, m_techs[tech_name]->Width(), m_techs[tech_name]->Height());
    }

    // create an edge for every prerequisite
    for (TechManager::iterator it = manager.begin(); it != manager.end(); ++it) {
        const Tech* tech = *it;
        if (!tech) continue;
        const std::string& tech_name = tech->Name();
        if (!TechVisible(tech_name, m_categories_shown, m_tech_statuses_shown)) continue;
        for (std::set<std::string>::const_iterator prereq_it = tech->Prerequisites().begin();
             prereq_it != tech->Prerequisites().end(); ++prereq_it)
        {
            if (!TechVisible(*prereq_it, m_categories_shown, m_tech_statuses_shown)) continue;
            m_graph.AddEdge(*prereq_it, tech_name);
        }
    }
I think here 2 loops may be combined into single loop:

Code: Select all

    DebugLogger() << "Tech Tree Layout Preparing Tech Data";
    TechManager& manager = GetTechManager();
    for (TechManager::iterator it = manager.begin(); it != manager.end(); ++it) {
        const Tech* tech = *it;
        if (!tech) continue;
        const std::string& tech_name = tech->Name();
        if (!TechVisible(tech_name, m_categories_shown, m_tech_statuses_shown)) continue;
        // create a node for every tech
        m_techs[tech_name] = new TechPanel(tech_name, this);
        m_graph.AddNode(tech_name, m_techs[tech_name]->Width(), m_techs[tech_name]->Height());
        // create an edge for every prerequisite
        for (std::set<std::string>::const_iterator prereq_it = tech->Prerequisites().begin();
             prereq_it != tech->Prerequisites().end(); ++prereq_it)
        {
            if (!TechVisible(*prereq_it, m_categories_shown, m_tech_statuses_shown)) continue;
            m_graph.AddEdge(*prereq_it, tech_name);
        }      
    }

---
added: I check this thing but got segfault :(

User avatar
asm64
Space Floater
Posts: 27
Joined: Fri Jan 31, 2014 6:57 am

Re: About freeorion's performance

#82 Post by asm64 »

Problem was in freetype-2.6.2. It cause slow rendering. With freetype-2.6.1 I have good performance.

banduri
Space Floater
Posts: 47
Joined: Tue Dec 15, 2015 6:20 pm
Location: Solaria

Re: About freeorion's performance

#83 Post by banduri »

asm64 wrote:I check this thing but got segfault :(
This is bc you tried to establish an edge between two nodes, but the second node was not part of the graph.
asm64 wrote:Problem was in freetype-2.6.2. It cause slow rendering. With freetype-2.6.1 I have good performance.
Could you check that again with the currentmaster? I had some bad FPS here too and are also on freetype 2.6.2.
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project (this includes pullrequest of the useraccount banduri at github)

Post Reply