AceConfig toggle in AceConfigDialog slow when clicked if width="full" #561


Open
  • Kemayo created this issue Oct 30, 2020

    I have an AceConfig group containing potentially a lot of user-added toggles. Clicking the toggle seems to take time in proportion to how many toggles are in the group, causing a perceptible freeze in the game, before the set function is even run.

     

    This only happens when width="full" is used. Some un-cached layout calculation being run?

  • nevcairiel posted a comment Oct 31, 2020

    Can you provide an example to demonstrate the problem?

  • Kemayo posted a comment Oct 31, 2020

    Sure: https://gist.github.com/kemayo/1821a9d608ea0954b7edfaf7a63a9886

     

    The test just creates a thousand toggles and registers them with config. When you click a toggle, on my system, everything locks up for ~6 seconds. If I remove the `width="full"` then it still freezes, but only for 1-2 seconds.

  • nevcairiel posted a comment Oct 31, 2020

    The difference is that when its full width, it has to dynamically recompute its height, which causes some re-layouting.

    I can potentially pause its layout for a bit, but I don't know if that'll have side-effects, so its risky, and will take extensive testing.

     

    Since checkboxes don't have a visible boundary, I would recommend to avoid dynamic sizing and use a static size. You can use "double" for double-wide, or even a number as a multiplier to the normal width, eg. width=1 would be equal to normal, width=2 to double, etc. (actual numbers, not numbers in strings)


    Edited Oct 31, 2020
  • nevcairiel posted a comment Oct 31, 2020

    The primary cause is the scroll frame, which dynamically shows/hides the scroll bar and thus resizes the content frame to make room for the scroll bar. Then all these dynamically sized checkboxes get resized, potentially changing their height, and thus requiring a full re-layout of the content.

     

    Not sure that can be safely changed, since a widget could change their height in that moment. Requiring careful design of potentially long lists of boxes is probably a better choice then odd layout issues. Silly scroll frame and its scroll bar. But if it wouldnt dynamically show/hide it, there would be even more complaints about wasted space.

  • Kemayo posted a comment Oct 31, 2020

     Maybe a way to flag that you're *sure* there'll be a scrollbar, so you don't care about that check?

  • nevcairiel posted a comment Nov 1, 2020

    That sort of control might work for AceGUI, but not for AceConfig.


To post a comment, please login or register a new account.