#62063 closed enhancement (fixed)
traverse_and_serialize_blocks calls is_callable for each block instance
| Reported by: | welcher | Owned by: | SergeyBiryukov |
|---|---|---|---|
| Priority: | normal | Milestone: | 6.7 |
| Component: | Editor | Version: | 6.4 |
| Severity: | normal | Keywords: | has-patch |
| Cc: | Focuses: | performance |
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.
2 years ago
#1
- Keywords has-patch added
#2
@
2 years 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:
2 years ago
#3
#4
@
2 years ago
- Component General → Editor
- Milestone Awaiting Review → 6.7
- Version → 6.4
Introduce in [56644].
Ping @bernhard-reiter for review.
@SergeyBiryukov commented on PR #7387:
2 years ago
#6
Thanks for the PR! Merged in r59077.
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
This PR caches the
is_callablecalls intraverse_and_serialize_blocksrather 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