Low Search 'appears' to be giving EE_Functions::prep_conditionals a hard time
I'm experiencing very slow rendering times when using conditionals in Low Search.
Here's a code sample of what I'm doing:
<form id="reorder" method="post" action="">
<select name="order" id="newSelection">
<option value="{low_search:url result_page='properties' orderby_sort='property_price|desc'}"{if low_search_orderby_sort == "property_price|desc"} selected="selected"{/if}>Highest price</option>
<option value="{low_search:url result_page='properties' orderby_sort='property_price|asc'}"{if low_search_orderby_sort == "property_price|asc"} selected="selected"{/if}>Lowest price</option>
<option value="{low_search:url result_page='properties' orderby_sort='date|desc'}"{if low_search_orderby_sort == "date|desc"} selected="selected"{/if}>Newest first</option>
<option value="{low_search:url result_page='properties' orderby_sort='property_percentage_change|desc'}"{if low_search_orderby_sort == "property_percentage_change|desc"} selected="selected"{/if}>Price change (increase)</option>
<option value="{low_search:url result_page='properties' orderby_sort='property_percentage_change|asc'}"{if low_search_orderby_sort == "property_percentage_change|asc"} selected="selected"{/if}>Price change (reduced)</option>
<option value="{low_search:url result_page='properties' orderby_sort='view_count_one|desc'}"{if low_search_orderby_sort == "view_count_one|desc"} selected="selected"{/if}>Most popular first</option>
<option value="{low_search:url result_page='properties' orderby_sort='property_living-area|desc'}"{if low_search_orderby_sort == "property_living-area|desc"} selected="selected"{/if}>Build size (highest)</option>
<option value="{low_search:url result_page='properties' orderby_sort='property_living-area|asc'}"{if low_search_orderby_sort == "property_living-area|asc"} selected="selected"{/if}>Build size (lowest)</option>
<option value="{low_search:url result_page='properties' orderby_sort='property_land-size|desc'}"{if low_search_orderby_sort == "property_land-size|desc"} selected="selected"{/if}>Plot size (highest)</option>
<option value="{low_search:url result_page='properties' orderby_sort='property_land-size|asc'}"{if low_search_orderby_sort == "property_land-size|asc"} selected="selected"{/if}>Plot size (lowest)</option>
</select>
</form>
With this particular snippet, in New Relic I'm seeing EE_Functions::prep_conditionals taking around 4 seconds and EE_Functions::assign_conditional_variables around 2.
Is there an optimal way of doing things? After looking into a lot of things it appears that it's PHP that is making Low Search slow, not the database.
Cheers
Jim
Replies
Low 16 Feb 2014 22:25
The conditionals in there aren't all that special, so it seems odd to me that that would be the cause of slowness. What's the whole template you're using? You can use http://pastie.org/ or http://pastebin.com/ for large chunks of code.
TamasBenke 9 Sep 2014 13:18
Hey Jim, I'm experiencing the same issue, and I was wondering whether you found a solution?