Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

[4.x] Cache Blueprint columns #8840

Merged
merged 5 commits into from
Oct 20, 2023
Merged

Conversation

jonassiewertsen
Copy link
Contributor

This change helps us with performance, especially if you open large entries.

It caches the calculated columns for a single request.

@jonassiewertsen jonassiewertsen changed the title Cache Blueprint columns [4.x] Cache Blueprint columns Oct 13, 2023
@jasonvarga
Copy link
Member

jasonvarga commented Oct 13, 2023

Are you planning on adding more to this PR? It's still a draft. Just remember to mark as ready when you are. 👍

@jonassiewertsen
Copy link
Contributor Author

This PR is complete.

It is a draft though, as I asked others if they can confirm the speed improvement to make 100% sure it's not tied to our custom setup.

@jeremyvienney
Copy link

I can confirm an improvement of around 15% in waiting server time response.
On an entry with ~20 sets from a replicator (so lot of content), average response time is cut from around 850ms to 700ms.
Thank you !

@jonassiewertsen jonassiewertsen marked this pull request as ready for review October 16, 2023 08:15
@jasonvarga
Copy link
Member

I'm curious how this is helping you. We aren't calling ->columns() in many places.

If you place ray()->count('columns') inside the columns() method on the 4.x branch, I can only really see it once per request in most places.

    public function columns()
    {
+       ray()->count('columns');

        $columns = $this->fields()

Do you have an addon or custom code where you are calling columns() more often?

@jeremyvienney
Copy link

I'm curious how this is helping you. We aren't calling ->columns() in many places.

If you place ray()->count('columns') inside the columns() method on the 4.x branch, I can only really see it once per request in most places.

    public function columns()
    {
+       ray()->count('columns');

        $columns = $this->fields()

Do you have an addon or custom code where you are calling columns() more often?

Hi Jason, it should be due indeed to some addons (Bard Texstyle for example seems to use it a lot), because it is called 9 times for me on a control panel entry edit page.

@jasonvarga
Copy link
Member

Can you show what addons are installed in the output of php please support:details ?

@jeremyvienney
Copy link

jeremyvienney commented Oct 17, 2023

Sure here it is :

aryehraber/statamic-logbook: 3.1.0
heidkaemper/statamic-toolbar: 1.1.0
jackabox/statamic-plausible-analytics: dev-main
jacksleight/statamic-bard-mutator: 2.3.0
ndx/statamic-bard-color-picker: 1.2.0
neoisrecursive/statamic-storage-info: 0.2.4
stoffelio/statamic-404-logger: 1.0.1
studio1902/statamic-peak-browser-appearance: 3.2
studio1902/statamic-peak-commands: 2.6.1
studio1902/statamic-peak-seo: 7.0.3
studio1902/statamic-peak-tools: 3.2
jacksleight/statamic-bard-texstyle: dev-main
zsoltjanes/statamic-ai-writer-for-bard: 1.0.3
riasvdv/statamic-position-fieldtype: dev-main
visuellverstehen/statamic-anchor-navigation: 0.3.5-beta
webographen/statamic-admin-log: 1.0.8

I just bought a Ray licence and figured out that it wasn't 9 call but 134 !

@jasonvarga jasonvarga merged commit 329000b into statamic:4.x Oct 20, 2023
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants