PySide Bugzilla Closed for New Bugs

PySide is now a Qt Add-on and uses the Qt Project's JIRA Bug Tracker instead of this Bugzilla instance. This Bugzilla is left for reference purposes.

Bug 928 - 100's of QGraphicItems with signal connections causes slowdown
: 100's of QGraphicItems with signal connections causes slowdown
Status: CLOSED FIXED
Product: PySide
Classification: Unclassified
Component: PySide
: 1.0.4
: Macintosh Mac OS
: P3 normal
Assigned To: renato filho
:
:
:
  Show dependency treegraph
 
Reported: 2011-07-11 22:19 EEST by Nick
Modified: 2011-08-23 00:35 EEST (History)
9 users (show)

See Also:


Attachments
Simple test case for progressive slowndown (1.16 KB, text/x-python)
2011-08-11 01:10 EEST, Michal Krenek (Mikos)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nick 2011-07-11 22:19:47 EEST
I have stable code from PyQt that is ported to PySide.  

It is a content generation program.  

"Everything" seems to work fine *except* when I add too many items to a
QGraphicsScene (100's) with signal connections.  

This code works fine in PyQt4, so I'm wondering what defect this could be since
I don't see anything resembling this in the bug list.

After time profiling using Run Snake Run on OS X, profiling seems to indicate
slowdown occurs during "connect" method connecting model signals to the
QGraphicsItems.

the following link shows profiling screengrabs of PySide (top image),
and PyQt (bottom image) (hosted at IMGUR, so I hope that's fine with
people)

http://imgur.com/a/ogqIS

As you can see, this slowdown is nonexistent on PyQt
Comment 1 renato filho 2011-07-20 00:34:18 EEST
could you provide some example code to test?
Comment 2 renato filho 2011-07-22 17:52:26 EEST
some optimizations was done on connect method but without your test is
impossible to say if this work in your case. Could you test that?

pyside commits before:

commit 11b3bd6bc865e762984f8aac8076e1e318a9a198
Author: Renato Filho <renato.filho@openbossa.org>
Date:   Fri Jul 22 10:22:05 2011 -0300


shiboken commits before:

commit d8a09e2a773e1686bef5d1b09deb50b6e8ec7008
Author: Renato Filho <renato.filho@openbossa.org>
Date:   Tue Jul 19 17:36:08 2011 -0300
Comment 3 renato filho 2011-08-01 23:42:52 EEST
I will close this bug since I did not get any feedback.
Comment 4 Nick 2011-08-02 04:07:11 EEST
The bug is still present with latest source.  I will attempt to reduce it but,
for the time being the fastest way for me to demonstrate the problem is to link
to the source.  I will fork it and port it to PySide tomorrow morning and post
the head to head branch hashes PyQt versus PySide.

the project is:
https://github.com/sdouglas/cadnano2
Comment 5 Nick 2011-08-02 04:25:17 EEST
git@github.com:sdouglas/cadnano2.git

PySide version 2cd741f4c843683b7fb8
PyQt version 871f5936fae219b2f558 or master

I will add auto test document loading tomorrow
Comment 6 renato filho 2011-08-05 20:14:01 EEST
some optimizations on dynamic metaobject, this make significant changes on
performance but we still working on that.

You can test using:

pyside git 7ecfb3e921bdc9777cf3a29937ff10d383bbe4f9
Comment 7 Michal Krenek (Mikos) 2011-08-11 01:10:51 EEST
Created attachment 394 [details]
Simple test case for progressive slowndown

I have created simple test case which shows this problem.

If I connect signals to method in class derived from QtCore.QObject, I get no
slowdown, it is very quick even if I connect thousands of signals.

But if I connect signals to method in class _not_ derived from QtCore.QObject
(standard Python class), there is massive progressive slowdown
(QObject.connect() calls get progressively slower and slower).
Comment 8 Michal Krenek (Mikos) 2011-08-11 01:12:51 EEST
Btw. I am using PySide 1.0.5 (not latest Git snapshot).
Comment 9 renato filho 2011-08-19 20:31:27 EEST
new optimizations implemented on pyside commit:

commit ad3a8ed9ce6bdba3c819df0a58b84deea2be6879
Author: Renato Filho <renato.filho@openbossa.org>
Date:   Thu Aug 18 17:51:13 2011 -0300



Could you confirm that fix the slowdown?

Thanks
Comment 10 renato filho 2011-08-22 23:46:40 EEST
Since we did not receive any reply during the release window, I will consider
this bug fixed. But fell free to re-open if you still getting the slowdown.
Comment 11 renato filho 2011-08-23 00:35:32 EEST
Released on PySide 1.0.6