I'm curious if anyone that has either done a comparison between the two or simply knows why one would be more efficient than the other. Stash set vs. set_list in storing multiple individual field variables for a single entry.
A template group index that generates "pages" on the basis of entries that includes, for example, the following fields:
- title (obviously)
- alt menu title
- body (RTE field)
- promo image
- extended body (RTE field)
- Meta Title
- Meta Description
- Meta Keywords
So to create a variable out of each one of these fields distinctly, I could either wrap each with a simple stash:set tag pair or I could wrap the whole thing with a stash:set_list tag pair and wrap each variable with the tag pair to set each as list elements.
Then in the wrapper template, in the set_list scenario, when I have several of these elements that actually need to appear together (like title, body, extended body and promo image, for example), I can use a single get_list tag pair to retrieve the several of them I need whereas with the simple set scenario, I would need a get for each variable separately, even if four of them follow one another sequentially in the markup.
What are the performance issues I should be worries about? Or should I be worries about it? To me, they seem to run about the same speed, but I wonder if the database and stash experts out there can speak to how/if there would be differences, particularly as the number of fields in a given field group climbs.
I have thought about the fact that the stashed body of the page could in fact combine several of the fields in the field group into a single stashed set (whether list or not). But for the purposes of this example/question, I thought I'd keep them separate.