Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Performance issue: slow pages section with table layout #6594

Open
distantnative opened this issue Jul 31, 2024 · 0 comments
Open

Performance issue: slow pages section with table layout #6594

distantnative opened this issue Jul 31, 2024 · 0 comments
Labels
type: performance ⚡️ Is about performance; improves performance

Comments

@distantnative
Copy link
Member

distantnative commented Jul 31, 2024

Problem description

In Kirby 4.2 and 4.3, the pages section currently can be hit by a drastic performance issue when used with table layout and using computational heavy parts anywhere in the blueprint (e.g. accessing a large index in a query).

This is because our field and blueprint classes resolve everything very greedily, unfortunately. So setups that somewhere in the blueprint work with the site index or just any performance-heavy thing really get tolled as likely for every table row the blueprints are newly resolved etc.

Current workaround

From Kirby 4.4. onwards, you can add rawvalues: true to your section in the blueprint. What does it do:

It reverts the behavior to pre-4.2, which is passing raw values from the content file to the table preview components. This can cause other problems with the field previews, e.g. the toggle field would receive a string not a bool. Some previews won't work then in your setup.

Overall, we know this isn't a great solution. It's more a trade-off for developers as many setups might be fine with one of the two versions: Some are not faced with the performance issue and are happy with correctly passed values, others might be able to work around the broken field previews as long as the pages section doesn't completely slow down the Panel for them.

Additional context

Code that causes the performance issue: https://github.com/getkirby/kirby/blob/main/config/sections/mixins/layout.php#L136-L150

@distantnative distantnative added the type: performance ⚡️ Is about performance; improves performance label Jul 31, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
type: performance ⚡️ Is about performance; improves performance
Projects
None yet
Development

No branches or pull requests

1 participant