Uploaded image for project: 'Qt for Python'
  1. Qt for Python
  2. PYSIDE-234

slow destroy Shiboken BindingManager

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Invalid
    • Not Evaluated
    • None
    • 1.2.x
    • Shiboken
    • None

    Description

      BindingManager destroctor is very slowly. (shiboken/libshiboken/bindingmanager.cpp Line #159)
      In my application, the static BindingManager is destroyed when exit the application, which make the exit take long time.

      The root cause is: WrapperMap::begin() is O.
      Proposer solution:
      Rewrite the code as:
      if (Py_IsInitialized()) { // ensure the interpreter is still valid
      WrapperMap::iterator it = m_d->wrapperMapper.begin();
      for (; it != m_d->wrapperMapper.end(); ++it)

      { Object::destroy(it->second, const_cast<void*>(it->first)); }

      assert(m_d->wrapperMapper.size() == 0);
      }
      Or make WrapperMap::begin() to O(1).

      Attachments

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

        Activity

          People

            Unassigned Unassigned
            wuni Nian Wu
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes