Make WordPress Core

Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#57815 closed enhancement (fixed)

Performance: move variables to where used in wp_render_layout_support_flag()

Reported by: spacedmonkey Owned by: spacedmonkey
Priority: normal Milestone: 6.3
Component: Editor Version:
Severity: normal Keywords: gutenberg-merge has-patch
Cc: Focuses: performance

Description

Improves the performance of wp_render_layout_support_flag() function by moving variables to where each is used.

If a return happens before the variable is needed, this change avoids unnecessary processing and memory.

Reference:

Change History (7)

#1 @hellofromTonya
3 years ago

  • Component GeneralEditor

#2 @spacedmonkey
3 years ago

  • Owner set to spacedmonkey
  • Status newassigned

#3 @mukesh27
3 years ago

This ticket was discussed in the recent performance bug scrub.

The GB PR already merged and just needs to back port it for core.

Props to @joemcgill

This ticket was mentioned in PR #4213 on WordPress/wordpress-develop by @spacedmonkey.


3 years ago
#4

  • Keywords has-patch added

This ticket was mentioned in Slack in #core-committers by spacedmonkey. View the logs.


3 years ago

#6 @spacedmonkey
3 years ago

  • Resolutionfixed
  • Status assignedclosed

In 55541:

Editor: Move variables to where used in wp_render_layout_support_flag.

Improves the performance of wp_render_layout_support_flag() function by moving variables to where each is used.
If a return happens before the variable is needed, this change avoids unnecessary processing and memory.

Props spacedmonkey, hellofromTonya, mukesh27.
Fixes #57815.

@spacedmonkey commented on PR #4213:


3 years ago
#7

Committed.

Note: See TracTickets for help on using tickets.