John Lokanis Posted October 15, 2009 Report Share Posted October 15, 2009 (edited) I have been trying to figure out a problem with the tree control that I just don't understand. For some reason, if I want to change the background color of a cell in the tree control, the amount of time this takes varies significantly based on what row I am changing. For an extreme example, I created a tree with 10,000 rows. I then timed how long it took to change the background color of the cell in row 0 and row 9999. The different was ~218x slower to set the color of row 9999. Turning defer updates off had no effect on the speed Using the row index instead of the tag name to set the active row had no effect on the speed In another experiment, I tried changing each row's background color. As the row number increased, the execution speed of the code slowed down. I then tried it in reverse, setting row 9999 first and then decrementing the row index through 0. This time the code got faster as it approached 0. This really seems strange to me. I can't imagine why it would take over 200ms to set something simple like a color property. See the attached VI for an example of this behavior.set tree cell color speed.vi Anyone have any ideas on how to speed this up? -John Edited October 15, 2009 by John Lokanis 1 Quote Link to comment
Darren Posted October 15, 2009 Report Share Posted October 15, 2009 I filed CAR# 191973 on this issue. Unfortunately, I don't know of a workaround. -D Quote Link to comment
smenjoulet Posted October 16, 2009 Report Share Posted October 16, 2009 This really seems strange to me. I can't imagine why it would take over 200ms to set something simple like a color property. It gets even stranger than that, at least for me. I downloaded your example just to see if I could figure out anything. This is what I saw: If you're near the top of the Tree (first 1000 rows or so) all operations seem to go normal speed. Scrolling (either with scroll bar or clicking the scroll arrows), selecting different rows, and changing tools happen quickly. But scroll to the last row and everything slows: 1) Scrolling slows to a crawl 2) Selecting rows is abysmally slow 3) Changing the tool is slow. Try hittting <TAB> 4 times quickly to move through the tool selection and watch the lag. 4) Even changing front panels is slowed. Switch from an empty VI to the example and back a few times. Scroll up to the top of the tree and repeat. I've seen it on two PC's, both in 8.6 and 2009. It's probably all related so hopefully it can be addressed by the same CAR. -Scott Quote Link to comment
John Lokanis Posted October 16, 2009 Author Report Share Posted October 16, 2009 I think they really need to rewrite the code that supports this control. It seems to have a lot of memory issues. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.