During displaying the search hits, in this case web content, the content's title and description or content is being displayed.
During collecting the title and description, a JournalArticleDisplay is created here:
During the JournalArticleDisplay creation, the web content templates are being processed.
With a simple template, the user doesn't experience any performance issue, but if we use a "heavy" template, then displaying the search results will be very slow. For that I added a long cycle.
1) Create a structure with a text field
2) Create a template for it, it should contain:
3) Uncheck the Cacheable in the template, (this is necessary to reproduce the issue)
4) Create 3 web contents based on this structure and template, all of them should contain the same word in the description or text field, for example: "summary". Set the Default Template and fill the Summary field as well for each web content.
5) Put a Search portlet to a page
6) Search for the word: "summary"
Finding the 3 web contents took 25 seconds, as the Template is being processed for 3 times
Reproduced on master: 56307b2bef62742af6c13ea1bea4acd9cc26c505