Jump to content

Performance Question


Tom.
 Share

Recommended Posts

I always wondered the best way of setting up fields in terms of Performance, do you have one field for example called "slider" which you can use across multiple templates, or is it better for performance to break down the field into templates:
"home_slider"
"journal_slider" 

For example, will it take longer to query the single entry for home slider among the potentially hundreds of entries for journal slider, if you use one field "slider". 

Link to comment
Share on other sites

Less fields is better for you - less to manage, but it won't matter to PW either way because all the field db tables (eg field_slider) are indexed by the pages_id so PW finds the relevant entries very quickly. Having a separate field won't improve this.

  • Like 3
Link to comment
Share on other sites

1 hour ago, LostKobrakai said:

That's true for the "1 or 2" fields question, but at bigger scale there can be harm, as it's more fields to load (each request does load all fields) and therefore also a bigger memory footprint.

But at what scale are we talking here where there will be a noticeable slowdown, because on some sites I setup lots of fieldsets to make things look nice. Are they loaded?

Link to comment
Share on other sites

The "official" blog post about this topic might also be of interest:
https://processwire.com/blog/posts/making-efficient-use-of-fields-in-processwire/

True, the word "performance" is not even mentioned in it, but I guess this is because this is not really about optimizing performance too much. Optimizing database access by means of proper usage of API calls and cache should matter the most.

  • Like 2
Link to comment
Share on other sites

15 hours ago, cb2004 said:

But at what scale are we talking here where there will be a noticeable slowdown

There's no way to answer that question. It depends on what one might find "noticable", what version of php is used, which database and version of it is used (mariadb != mysql) and in the and also on the hardware used.

15 hours ago, cb2004 said:

on some sites I setup lots of fieldsets to make things look nice. Are they loaded?

Yeah they're all loaded. But really fieldsets are probably the fieldtype with the smallest footprint anyways.

  • Like 2
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...