Uploaded image for project: 'Qbs ("Cubes")'
  1. Qbs ("Cubes")
  2. QBS-778

A lot of deep copying of std::sets

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 1.4.1
    • 1.3.4
    • General
    • None
    • 08170b040e304d3b4d5ac0448c7ecc5fbf87797a

    Description

      While profiling QBS on pretty large project I noticed that the function causing a huge slowdown is allChildrenBuilt function in lib/corelib/buildgraph/executor.cpp. The function is pretty simple:

      foreach (BuildGraphNode *child, node->children)
             if (child->buildState != BuildGraphNode::Built)
                  return false;
      return true;
      

      The problem is that node->children is std::set and thus deep-copy on it is performed each time Qt foreach is done. After changing it to iterator based loop, performance seriously improved. But that isn't the only place where foreach is used on std::set.

      Suggested workarounds:

      • Change every usage of std::set to QSet
      • Carefully find all foreach used on std::set and change them to iterator based for

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            jbornema Joerg Bornemann
            predelnik Sergey Semushin
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes