#62063 closed enhancement (fixed)
traverse_and_serialize_blocks calls is_callable for each block instance
Reported by: | welcher | Owned by: | SergeyBiryukov |
---|---|---|---|
Milestone: | 6.7 | Priority: | normal |
Severity: | normal | Version: | 6.4 |
Component: | Editor | Keywords: | has-patch |
Focuses: | performance | Cc: |
Description
In the traverse_and_serialize_blocks function, the second and third parameters are checked for null for each block in the loop. This check can be done instead once when the function is invoked and cached in variables.
Change History (6)
This ticket was mentioned in PR #7387 on WordPress/wordpress-develop by @welcher.
4 weeks ago
#1
- Keywords has-patch added
#2
@
4 weeks ago
If this is approved/merged, can we please add Cybr to the props as they brought this to my attention and deserve to share credit.
@mukesh27 commented on PR #7387:
4 weeks ago
#3
#4
@
4 weeks ago
- Component changed from General to Editor
- Milestone changed from Awaiting Review to 6.7
- Version set to 6.4
Introduce in [56644].
Ping @bernhard-reiter for review.
#5
@
4 weeks ago
- Owner set to SergeyBiryukov
- Resolution set to fixed
- Status changed from new to closed
In 59077:
@SergeyBiryukov commented on PR #7387:
4 weeks ago
#6
Thanks for the PR! Merged in r59077.
Note: See
TracTickets for help on using
tickets.
This PR caches the
is_callable
calls intraverse_and_serialize_blocks
rather than calling it for each iteration of the foreach loop. This should improve the performance of the function.Trac ticket: https://core.trac.wordpress.org/ticket/62063