[wp-trac] [WordPress Trac] #32103: Multidimensional Customizer settings (options & theme mods) are not scalable

WordPress Trac noreply at wordpress.org
Sat Oct 10 09:05:06 UTC 2015


#32103: Multidimensional Customizer settings (options & theme mods) are not
scalable
------------------------------+--------------------------
 Reporter:  Air.              |       Owner:  westonruter
     Type:  defect (bug)      |      Status:  closed
 Priority:  normal            |   Milestone:  4.4
Component:  Customize         |     Version:  3.4
 Severity:  normal            |  Resolution:  fixed
 Keywords:  has-patch commit  |     Focuses:  performance
------------------------------+--------------------------
Changes (by westonruter):

 * status:  accepted => closed
 * resolution:   => fixed


Comment:

 In [changeset:"35007"]:
 {{{
 #!CommitTicketReference repository="" revision="35007"
 Customizer: Fix scalability performance problem for previewing
 multidimensional settings.

 As the number of multidimensional settings (serialized options and theme
 mods) increase for a given ID base (e.g. a widget of a certain type), the
 number of calls to the `multidimensional` methods on
 `WP_Customize_Setting` increase exponentially, and the time for the
 preview to refresh grows in time exponentially as well.

 To improve performance, this change reduces the number of filters needed
 to preview the settings off of a multidimensional root from N to 1. This
 improves performance from `O(n^2)` to `O(n)`, but the linear increase is
 so low that the performance is essentially `O(1)` in comparison. This is
 achieved by introducing the concept of an "aggregated multidimensional"
 setting, where the root value of the multidimensional serialized setting
 value gets cached in a static array variable shared across all settings.

 Also improves performance by only adding preview filters if there is
 actually a need to do so: there is no need to add a filter if there is an
 initial value and if there is no posted value for a given setting (if it
 is not dirty).

 Fixes #32103.
 }}}

--
Ticket URL: <https://core.trac.wordpress.org/ticket/32103#comment:41>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list