Closed o1y closed 5 months ago
Same here. It takes up to 5 seconds when an input is clicked until we are able to actually type something. That makes the CMS unusable. (PageBuilder with lots of repeater fieldtypes on 4.41.0)
Please Fix!
@paul-hph Do you have a performance issue in the frontend when clicking through the replicator sets, or is it slow when loading the initial entry from the backend (php-side)?
Both. 20 second page load. 12 seconds to be able to edit a field.
I'd say I can reproduce this in "small". We only have max 15 replicator sets per page and the more there are, the longer the page load is. Larger pages (10-15) tend to load around 5-10 seconds TTFB and smaller pages (<10 sets) are around 3-5 seconds.
@paul-hph This seems mostly JS / Vue related and possibly not related to this issue, which is about replicator metadata in php. You page was loaded in about 3-4s (TTFB), which this PR could improve #8397. I would rather open a new issue for the JS part.
Are you using lots of Bard sets? Then @jacksleight did some performance checks here in https://github.com/statamic/cms/pull/8716#issuecomment-1729391783
I just tested your PR @o1y - and I noticed the following changes on some pages:
regarding TTFB times
Fixed in PR #10280
Bug description
When creating a "Page Builder" using a combination of a Replicator and Bard Field with various imported Content Sets, the Replicator Field tends to load slowly. This is especially in situations where sets need to be nested, for example when creating a columns/layout or accordion/collapse set. This results in a performance problem as the Replicator Field needs to preload the same fields over and over.
I have identified two possible causes for this issue:
The
toPublishArray()
method is being executed multiple times for the same fields. https://github.com/statamic/cms/blob/62451f1d39e3f998db1f6940d1111c43b8453016/src/Fields/Fields.php#L147-L150The
preload()
method of the Replicator Field is loading the same metadata multiple times for the same config:https://github.com/statamic/cms/blob/62451f1d39e3f998db1f6940d1111c43b8453016/src/Fieldtypes/Replicator.php#L203
I understand that this is a specific case that mainly affects those building Page Builders, like me :) However, I have noticed similar performance challenges mentioned on Discord, and we have also encountered them in our project.
How to reproduce
publish-array-performance
and open the Home entry in the pages collection.Logs
No response
Environment
Installation
Fresh statamic/statamic site via CLI
Antlers Parser
None
Additional details
No response