WordPress/wp-includes/block-supports
jorgefilipecosta 5a6c222bfa Update: Improve performance of gutenberg_render_layout_support_flag.
Backports https://github.com/WordPress/gutenberg/pull/46074 into the core.
render_layout_support_flag is run per block, and inside we called get_global_settings three times. get_global_settings calls get_merged_data, which is costly. render_layout_support_flag is a filter called during the block render. When the blocks start rendering, there is no expectation that the theme.json settings change during the block render, so the settings and their derived information should all be static information of this function.
This simple change removes 3*NUMBER_OF_BLOCKS calls of get_merged_data to just one call.

Props oandregal, aristath, felixarntz, tellthemachines, andrewserong, aaronrobertshaw, aaronrobertshaw.
Built from https://develop.svn.wordpress.org/trunk@55167


git-svn-id: http://core.svn.wordpress.org/trunk@54700 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-31 15:24:14 +00:00
..
align.php Docs: Miscellaneous Docblock corrections in several /block-supports files. 2021-12-01 23:16:04 +00:00
border.php Editor: Backport block supports (border, color, elements, spacing) from Gutenberg to WP 6.1. 2022-09-19 20:14:10 +00:00
colors.php Docs: Use third-person singular verbs for Block Supports related function descriptions, as per docblocks standards. 2022-11-24 22:36:11 +00:00
custom-classname.php Docs: Use third-person singular verbs for Block Supports related function descriptions, as per docblocks standards. 2022-11-24 22:36:11 +00:00
dimensions.php Editor: Backport block support changes from the Gutenberg plugin 2022-04-05 12:08:02 +00:00
duotone.php Editor: Remove WP_DEBUG defined check in wp_tinycolor_hue_to_rgb(). 2023-01-25 21:56:15 +00:00
elements.php Docs: Various docblock fixes in Block Supports related functions. 2022-11-24 22:52:11 +00:00
generated-classname.php Docs: Various docblock fixes in Block Supports related functions. 2022-11-24 22:52:11 +00:00
layout.php Update: Improve performance of gutenberg_render_layout_support_flag. 2023-01-31 15:24:14 +00:00
spacing.php Docs: Various docblock fixes in Block Supports related functions. 2022-11-24 22:52:11 +00:00
typography.php Editor: Adds 'settings.typography.fluid.minFontSize' support to wp_get_typography_font_size_value(). 2023-01-24 20:40:10 +00:00
utils.php Editor: Backport block support changes from the Gutenberg plugin 2022-04-05 12:08:02 +00:00