Tom. Posted February 23, 2017 Share Posted February 23, 2017 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 More sharing options...
adrian Posted February 23, 2017 Share Posted February 23, 2017 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. 3 Link to comment Share on other sites More sharing options...
cb2004 Posted February 23, 2017 Share Posted February 23, 2017 If home_slider and journal_slider contain exactly the same details just go for 1, less to manage. No harm in having 2 though. 1 Link to comment Share on other sites More sharing options...
LostKobrakai Posted February 23, 2017 Share Posted February 23, 2017 8 minutes ago, cb2004 said: No harm in having 2 though. 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. Link to comment Share on other sites More sharing options...
cb2004 Posted February 23, 2017 Share Posted February 23, 2017 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 More sharing options...
szabesz Posted February 23, 2017 Share Posted February 23, 2017 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. 2 Link to comment Share on other sites More sharing options...
LostKobrakai Posted February 24, 2017 Share Posted February 24, 2017 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. 2 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now