Author Topic: Slow response in Layout Tab - is it me? :)  (Read 756 times)

Offline brett

  • Newbie
  • *
  • Posts: 34
    • View Profile
Slow response in Layout Tab - is it me? :)
« on: July 23, 2018, 10:08:26 PM »
Hi Team

Running .22 here (have been since release).  I have noticed that if I do many things in the layout tab (add a model, delete a model, save a model, rename a model, add a group, etc) Xlights go non-responsive for up to 2 minutes before coming back.    During this time the layout itself disappears, a spinning blue circle (on PC w/ Win10) spins and the title bar of Xlights goes to "Not Responding".    I can typically edit within a model (submodels, custom model detail, etc) and  save with no issues, but otherwise doing anything with groups, new models, or copying/pasting seems to be very slow.   Are there any known areas I can focus on to speed it up or is it likely/possible that my layout just has too much going on that is slowing it down?  Appreciate any insight or advice.  Thanks, Brett

Offline Gilrock

  • Supporting Member
  • Hero Member
  • *
  • Posts: 6946
    • View Profile
Re: Slow response in Layout Tab - is it me? :)
« Reply #1 on: July 24, 2018, 08:08:00 AM »
That's just sounds like computers to me.  I've seen mine go out to lunch for no apparent reason and I yell at the screen saying WTF are you doing?.  Doesn't seem to be associated with any particular program.

I don't know what your layout looks like but just remember the code has to loop through ALL models and groups many times for a good portion of the operations you do on the layout page.  So if you have a crazy number of models and groups and views then yes expect it to cause a slowdown.  Sometimes I troubleshoot issues users post here and I see what they have and I'm thinking what are you doing. Many things are being used in unintended ways.  Like I saw someone trying to use views to save different copies of their show for each year.  I was like ummm normal users make a copy of the show directory...lol.

Offline brett

  • Newbie
  • *
  • Posts: 34
    • View Profile
Re: Slow response in Layout Tab - is it me? :)
« Reply #2 on: July 26, 2018, 10:11:52 PM »
Hey Gil - here is my packaged logs file.   I do see some strange errors in the log that I don't understand, especially the errors in the beginning about models not being in groups or not existing - they definitely exist and are in the groups.   (a) still wondering if I have gremlines, or (b) did I just get to big / complex?  Had to modify and save custom layouts / submodels on 8 models last night, took about 30 minutes.

Offline Gilrock

  • Supporting Member
  • Hero Member
  • *
  • Posts: 6946
    • View Profile
Re: Slow response in Layout Tab - is it me? :)
« Reply #3 on: July 27, 2018, 07:28:34 AM »
Ok thanks I'll look at it later today.  Maybe suggest a couple things I should try that would be slow on your setup.

Offline Gilrock

  • Supporting Member
  • Hero Member
  • *
  • Posts: 6946
    • View Profile
Re: Slow response in Layout Tab - is it me? :)
« Reply #4 on: July 27, 2018, 07:44:55 AM »
I browsed the files in a text editor and you have 77 model groups and you have several of them nested inside other groups.  That's why its saying they are missing is my guess cause its really not a model its a group so the check sequence must not be modified yet to account for nested groupings.  And be sure you don't have a situation where A contains B which contains C which contains A.

The other warnings about it thinking there are 50,000+ nodes in some of those models is a cause for concern.  Have you looked at one of those models to verify the setup?

By the way just your xlights_rgbeffects.xml file by itself seemed to be brining my UltraEdit program to its knees.  I couldn't easily scroll through the file for some reason and that's just a text editor.

Offline dkulp

  • Supporting Member
  • Hero Member
  • *
  • Posts: 812
    • View Profile
Re: Slow response in Layout Tab - is it me? :)
« Reply #5 on: July 27, 2018, 07:46:59 AM »
I took a loot at it last night... the BULK of the time is spent re-populating the wxTreeListCtrl on the LayoutPanel.   On OSX (not sure about windows), every AddItem invokes a very slow insert sort making a bunch of calls on the comparator.  We might be able to speed things up a bit by pre-sorting and adding, but that's a big pain.   It's especially bad if the user had clickes on the start channel column or similar to sort by channel number.

I'm experimenting with a few options:
1) Unset the comparator for the entire add, then set it and re-sort

2) Set the sort column to the first column, then set back

3) Unset the sorting entirely

(3) helps the most, but the issue is that it's completely not implemented on OSX.   I don't know about Windows.   I submitted a patch to wxWidgets to add the implementation of OSX so we'll see if it's accepted.    With the patch, and some updates to xLights to use it, a "delete model" drop from about 13 seconds to under 2.  Still slow, but much better.

Another thought I had was to change from wxTreeListCtrl to wxDataViewTreeCtrl.    I *think* we could then create an entirely new wxDataViewModel with the new data and then associate the new model with the tree.   That's definitely more work though.
Daniel Kulp
Framingham, MA

Offline Gilrock

  • Supporting Member
  • Hero Member
  • *
  • Posts: 6946
    • View Profile
Re: Slow response in Layout Tab - is it me? :)
« Reply #6 on: July 27, 2018, 08:00:38 AM »
Yeah I don't know if I would do a big change swapping to a different control if we were going to switch to Qt soon.  I'm onboard with switching but I'd like to finish off getting the 3D branch merged before doing the huge switch.

Offline brett

  • Newbie
  • *
  • Posts: 34
    • View Profile
Re: Slow response in Layout Tab - is it me? :)
« Reply #7 on: July 27, 2018, 10:53:15 AM »
Guys thanks for digging into this.  I will look at the nested groups and/or get rid of nested groups altogether if that's a major concern.

I am almost ALWAYS working in the layout view with sort by start channel since I am not using absolute addressing I find it to be the best way to keep myself sane to ensure no overlap and that in-sequence props are numbered right.  I can absolutely unsort or go back to the default name sort before adding/changing models if that helps.

I'll re-read your notes and if there are other things I can do, will do.   Thank you for taking the time.

Offline Gilrock

  • Supporting Member
  • Hero Member
  • *
  • Posts: 6946
    • View Profile
Re: Slow response in Layout Tab - is it me? :)
« Reply #8 on: July 27, 2018, 11:03:33 AM »
I'd give us a day before you do any major deletion or changes.  I remember we had a similar slowdown happen before so we need to inspect any code changes done to the layout file in the past few months.  I like to test in older versions to check for a major performance change.

Offline Gilrock

  • Supporting Member
  • Hero Member
  • *
  • Posts: 6946
    • View Profile
Re: Slow response in Layout Tab - is it me? :)
« Reply #9 on: July 27, 2018, 11:38:42 AM »
I did notice it appears you are creating pieces of models as models and then using a group to gather the pieces into a model and then that group is used in other groups.  Like for instance you are using a SingleLine model for each segment of a window and then grouping the single lines together to create a window model.  Is there a reason you aren't using the Window model or a PolyLine model to define the window?  I believe you could get to each of those sides as either strands or by creating submodels if you have a need to group the pieces.

Offline brett

  • Newbie
  • *
  • Posts: 34
    • View Profile
Re: Slow response in Layout Tab - is it me? :)
« Reply #10 on: July 27, 2018, 02:36:14 PM »
Hey Gil.   Yeah the windows.... those were the very first models I made when I first downloaded xlights and literally had no clue.  I think I tried both window model and polylines but had a couple of issues, and I think the "3-pane big windows" that had the "internal vertical lines" didn't work either way (at least when I tried it then) so I ended up making it the way you described.  It's worked for me, but it does create bloat.  I've got about 9 sequences done and based on how I built it - I think I need to wait to next year to re-do it the right way.   If you see that as part of the issue with the layout speed issues, and it's related to nested groups, I can certainly unnest the groups and add the invididual models.

Offline Gilrock

  • Supporting Member
  • Hero Member
  • *
  • Posts: 6946
    • View Profile
Re: Slow response in Layout Tab - is it me? :)
« Reply #11 on: July 27, 2018, 08:07:04 PM »
I tested Brett's layout with 2018.01 and deleting a model is very fast.  I do the same operation with 2018.22 and it takes 6 to 8 seconds.  With Dan's checkin its back down to about a second but I wonder what changed that caused it to get that slow. 

Offline jeremy0203

  • Newbie
  • *
  • Posts: 18
    • View Profile
Re: Slow response in Layout Tab - is it me? :)
« Reply #12 on: July 28, 2018, 01:42:01 AM »
Yes I have noticed it over at least the past few releases or more. Adding and deleting items has taken longer for them to populate on screen than it used to.

Offline jnealand

  • Hero Member
  • *****
  • Posts: 1421
    • View Profile
Re: Slow response in Layout Tab - is it me? :)
« Reply #13 on: July 28, 2018, 09:23:26 AM »
After coming back from expo with some new props to add I saw the same thing and had weird things happening when downloading models thru the import feature.  Kept getting xml error messages with different error line numbers.  Finally quit getting messages saved the layout exited xlights and came back in and now no more errors since then.  I did not write down the line numbers as I thought maybe it was me as I have not tried the model download prior to this.  But the speed between even moving a model or resizing it was really slow from what I had experienced in the past.  The models I added were the Boscoyo 46" spinners.
Jim Nealand
Kennesaw, GA