Make WordPress Core

Opened 3 months ago

Closed 3 months ago

Last modified 3 months ago

#57815 closed enhancement (fixed)

Performance: move variables to where used in wp_render_layout_support_flag()

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

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 months ago

  • Component changed from General to Editor

#2 @spacedmonkey
3 months ago

  • Owner set to spacedmonkey
  • Status changed from new to assigned

#3 @mukesh27
3 months 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 months ago
#4

  • Keywords has-patch added

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


3 months ago

#6 @spacedmonkey
3 months ago

  • Resolution set to fixed
  • Status changed from assigned to closed

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 months ago
#7

Committed.

Note: See TracTickets for help on using tickets.