Performance - drawing a large gizmos.TreeListCtrl faster

Hello,

Using wxPython Phoenix, I have a gizmos.TreeListCtrl with many nodes I’m trying to draw faster. The code is as below:

https://github.com/alex314159/DataFrameToTreeListCtrl/blob/master/DataFrameToTreeListCtrlPhoenix.py

I have a notebook with several tabs, three of which have one of these TreeListCtrl which can expand to 15,000 nodes, each. While the application works flawlessly once it’s up and running, the initial drawing takes 7 minutes, which is not very user friendly. Is there a way to make things faster?

My initial thoughts:

*Drawing the tree as the user expands a node - while each tree has 15,000 nodes, users will probably only have 50-100 nodes expanded at one time. How can I do that? Will the panel resize accordingly (scrollbars in particular)

*Failing that, is there a way to keep the application responsive while the trees are being drawn? So users can interact with other tabs in the notebook, and get alerted when the tree is usable?

Thank you very much,

Alex

Hi,

Hello,

Using wxPython Phoenix, I have a gizmos.TreeListCtrl with many nodes I’m trying to draw faster. The code is as below:

https://github.com/alex314159/DataFrameToTreeListCtrl/blob/master/DataFrameToTreeListCtrlPhoenix.py

I have a notebook with several tabs, three of which have one of these TreeListCtrl which can expand to 15,000 nodes, each. While the application works flawlessly once it’s up and running, the initial drawing takes 7 minutes, which is not very user friendly. Is there a way to make things faster?

My initial thoughts:

*Drawing the tree as the user expands a node - while each tree has 15,000 nodes, users will probably only have 50-100 nodes expanded at one time. How can I do that? Will the panel resize accordingly (scrollbars in particular)

*Failing that, is there a way to keep the application responsive while the trees are being drawn? So users can interact with other tabs in the notebook, and get alerted when the tree is usable?

I didn’t go through the code, but how many levels do you have in the tree? I.e., are all the 15,000 nodes children of the root?

If that’s not the case, you may want to investigate using “lazy” tree structures, where you add/remove children nodes when their parent is expanded/collapsed.

See, for a few ideas:

https://wiki.wxpython.org/TreeControls#Lazy_Evaluation_Directory_Browser_Example

Andrea.

···

On Fri, 9 Nov 2018 at 16.48, Alexandre Almosni alexandre.almosni@gmail.com wrote:

Thank you very much,

Alex

You received this message because you are subscribed to the Google Groups “wxPython-users” group.

To unsubscribe from this group and stop receiving emails from it, send an email to wxpython-users+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Thank you Andrea, let me have a look! I think this is exactly what I’m looking for actually.

···

On 9 Nov 2018, at 15:58, Andrea Gavana andrea.gavana@gmail.com wrote:

Hi,

On Fri, 9 Nov 2018 at 16.48, Alexandre Almosni alexandre.almosni@gmail.com wrote:

Hello,

Using wxPython Phoenix, I have a gizmos.TreeListCtrl with many nodes I’m trying to draw faster. The code is as below:

https://github.com/alex314159/DataFrameToTreeListCtrl/blob/master/DataFrameToTreeListCtrlPhoenix.py

I have a notebook with several tabs, three of which have one of these TreeListCtrl which can expand to 15,000 nodes, each. While the application works flawlessly once it’s up and running, the initial drawing takes 7 minutes, which is not very user friendly. Is there a way to make things faster?

My initial thoughts:

*Drawing the tree as the user expands a node - while each tree has 15,000 nodes, users will probably only have 50-100 nodes expanded at one time. How can I do that? Will the panel resize accordingly (scrollbars in particular)

*Failing that, is there a way to keep the application responsive while the trees are being drawn? So users can interact with other tabs in the notebook, and get alerted when the tree is usable?

I didn’t go through the code, but how many levels do you have in the tree? I.e., are all the 15,000 nodes children of the root?

If that’s not the case, you may want to investigate using “lazy” tree structures, where you add/remove children nodes when their parent is expanded/collapsed.

See, for a few ideas:

https://wiki.wxpython.org/TreeControls#Lazy_Evaluation_Directory_Browser_Example

Andrea.

Thank you very much,

Alex

You received this message because you are subscribed to the Google Groups “wxPython-users” group.

To unsubscribe from this group and stop receiving emails from it, send an email to wxpython-users+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

You received this message because you are subscribed to the Google Groups “wxPython-users” group.

To unsubscribe from this group and stop receiving emails from it, send an email to wxpython-users+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.