• Resolved Mike Schinkel

    (@mikeschinkel)


    For hook 'tailor_control_args_colorpicker' which calls tailor_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

    • This topic was modified 7 years, 7 months ago by Mike Schinkel.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Andrew Worsfold

    (@andrewworsfold)

    Thanks for this, @mikeschinkel!

    I’ve adapted the code and applied it to the tailor_modify_colorpicker function. This change will be made available in the next release.

    Thread Starter Mike Schinkel

    (@mikeschinkel)

    Hi Andrew,

    Can’t tell you how pleasantly pleased I am to get your affirmative reply. I frequently post fixes for plugins, but almost never hear back from the plugin developer, so kudos!

    Looking forward to the update.

    -Mike

    • This reply was modified 7 years, 7 months ago by Mike Schinkel.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Here is a performance fix for you; please apply’ is closed to new replies.