Here is a performance fix for you; please apply
-
For hook
'tailor_control_args_colorpicker'
which callstailor_modify_colorpicker()
can be called literally over a thousand times a page load, and it is very slow to run.What’s more, it initializes the palette array to the exact same value using an expensive-to-run calculation, so it duplicates effort like crazy.
Let me please suggest rather than recalculate the value every time that you store the initialized value in a static and simple reassign the static each time.
That is what what the following plugin does to shave almost a second off a complex page load, but my plugin adds complexity when you could just do it in Tailor:
https://gist.github.com/mikeschinkel/f685c1d55fba1f6abd0aa8fac80fe7cd
- The topic ‘Here is a performance fix for you; please apply’ is closed to new replies.