Slow loading on Block Config/Layout Builder pages

Created on 16 January 2025, 5 days ago

With UI Styles Layout Builder and UI Styles Block enabled, opening the config forms for items is slowed down quite drastically.

I have UI Suite DaisyUI installed that has a decent number of styles to select.

However, the amount doesn't seem like it should slow things down, so there must be something else happening here.

πŸ› Bug report
Status

Active

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States mortona2k Seattle

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @mortona2k
  • πŸ‡«πŸ‡·France Grimreaper France πŸ‡«πŸ‡·

    Hi,

    Thanks for your feedback.

    So this happens in 2 areas, Structure > Block Layout and in blocks in Layout Builder?

    Does it happens in other places with UI Styles? section config form in Layout Builder, Theme regions with ui_styles_page, etc.

    In structure block layout, if you uninstall ui_styles_block, there is no more slow down?

  • πŸ‡ΊπŸ‡ΈUnited States mortona2k Seattle

    Yes that's right. All those interfaces where UI Styles are loading.

    Going from the page to Configure Block took about 6+ seconds. Dropped to 1 after disabling UI Styles Block.

    About the same for layout builder blocks and sections forms.

    6 seconds is not huge, but when working on building up a page in layout builder using a lot of styles, it can take a lot of extra time.

    This is noticeable with a fresh setup.

  • πŸ‡«πŸ‡·France Grimreaper France πŸ‡«πŸ‡·

    Strange because, I quickly checked the daisyUI styles and there is like 800 lines. While UI Suite Bootstrap has like 1500 lines and I don't have slowness problem with Bootstrap with CSS aggregation disabled, and cache disabled.

    Would it be the CSS file generated on the fly for preview with UI Styles widget/source?

  • πŸ‡«πŸ‡·France Grimreaper France πŸ‡«πŸ‡·

    So the problem is that with Daidy UI the styleheet generation ui_styles/stylesheet.css?prefix=.ui-styles-source-select-plugin takes 6 sec.

    Checking mine with Bootstrap, it takes 50ms. And Bootstrap has more styles than Daisy UI.

    So it highly depends on how those classes are used, how the CSS is organized.

    It also made me realize that the controller response is not cached in the browser, and the payload is not optimized (removing empty lines, white space).

    So, we need to:
    - make the controller response cacheable (even if it should already be the case), if not possible, save the generated file in public stream wrapper.
    - optimize the payload.

Production build 0.71.5 2024