You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is based on the "Align and Distribute" window in my Pop Up Tools extension, so this is a real world example. This takes about 0.7 seconds to close on my old iMac. This makes the UI feel very laggy.
Edit: This code isn't correct. I'm sketching some new options.
# def _breakCycles(view):# """# Break cyclic references by deleting _target attributes.# """# if "setVanillaWrapper_" in view.__class__.__dict__:# try:# view._breakCycles()# except AttributeError:# pass# for view in view.subviews():# _breakCycles(view)
This reduces the _breakCycles time by about 40%, so it's still not great. It seems that a lot of time is wasted when the try: fails. I wonder if we could leverage getNSSubclass to give us a faster way to determine if _breakCycles needs to be called. Maybe we'd keep a set of class names that have gone through getNSSubclass that has a _breakCycles?
Closing windows is slow. Example:
This is based on the "Align and Distribute" window in my Pop Up Tools extension, so this is a real world example. This takes about 0.7 seconds to close on my old iMac. This makes the UI feel very laggy.
I've tracked this down to the use of
hasattr
in the ultimate_breakCycles
function. This is called once for every single view in a window, thus the more views a window has, the slower it becomes. I'm trying to find a way to speed this up but the best I'm coming up with are super hacky things like:Edit: This code isn't correct. I'm sketching some new options.
This reduces the _breakCycles time by about 40%, so it's still not great. It seems that a lot of time is wasted when the
try:
fails. I wonder if we could leverage getNSSubclass to give us a faster way to determine if_breakCycles
needs to be called. Maybe we'd keep a set of class names that have gone throughgetNSSubclass
that has a_breakCycles
?cc @justvanrossum @typemytype
The text was updated successfully, but these errors were encountered: