#59441 closed defect (bug) (fixed)
Use instanceof in block_has_support
| Reported by: | spacedmonkey | Owned by: | spacedmonkey |
|---|---|---|---|
| Priority: | normal | Milestone: | 6.4 |
| Component: | Editor | Version: | 5.8 |
| Severity: | normal | Keywords: | has-patch commit |
| Cc: | Focuses: | performance |
Description
The function block_has_support can be called around 4000 times on a page load. The property_exists check, can be expensive. Replaces it with instanceof, is much faster.
Change History (6)
This ticket was mentioned in PR #5294 on WordPress/wordpress-develop by @spacedmonkey.
3 years ago
#2
- Keywords has-patch added
Trac ticket: https://core.trac.wordpress.org/ticket/59441
This ticket was mentioned in Slack in #core-performance by spacedmonkey. View the logs.
3 years ago
@spacedmonkey commented on PR #5294:
3 years ago
#6
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Example profile that saves around 4ms which is around 2.5% of server time.
https://blackfire.io/profiles/compare/c13c320b-88ec-43bf-a5fb-6d5902cda78e/graph