You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After profiling our code I noticed that smarty spends quite some time in array_filter and strlen. Since the objective seems to be to eliminate empty entries from the array the second parameter is not necessary. If no second parameter is given all entries evaluating to false are eliminated - which has the same net effect - at a much lower performance cost.
I could not find any differences in the output. Could we remove the unnecessary strlen here?
The text was updated successfully, but these errors were encountered:
uwetews
added a commit
to smarty-php/smarty-lexer
that referenced
this issue
Nov 6, 2016
Thanks for bringing this up.
The master branch is now updated with the optimized lexer.
Besides array_filter() some additional optimizations have been made.
After profiling our code I noticed that smarty spends quite some time in array_filter and strlen. Since the objective seems to be to eliminate empty entries from the array the second parameter is not necessary. If no second parameter is given all entries evaluating to false are eliminated - which has the same net effect - at a much lower performance cost.
I could not find any differences in the output. Could we remove the unnecessary strlen here?
The text was updated successfully, but these errors were encountered: