weakref, memory management and execution slow down in PyQt4

Michael Torrie torriem at gmail.com
Mon Sep 8 19:51:25 EDT 2014


On 09/07/2014 02:39 PM, kjs wrote:
> The code is minimal[0]. The only other widgets are a start button that
> fires off the plotting and a stop button that calls sys.exit().

Unfortunately there are no data files in your git repository so I can't
run it.

> 
> Lines 112-114 appear to be causing the weakref proliferation.

Is there a reason you are using setattr and getattr instead of a proper
data structure?  both of those calls are rather expensive.  Would
probably be cheaper to use some kind of array, dictionary, or other
purpose-built data structure?



More information about the Python-list mailing list