#59441 closed defect (bug) (fixed)
Use instanceof in block_has_support
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 6.4 | Priority: | normal |
| Severity: | normal | Version: | 5.8 |
| Component: | Editor | Keywords: | has-patch commit |
| Focuses: | performance | Cc: |
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.
2 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.
2 years ago
#4
@
2 years ago
- Keywords commit added
- Owner set to spacedmonkey
- Status changed from new to assigned
@spacedmonkey commented on PR #5294:
2 years ago
#6
Note: See
TracTickets for help on using
tickets.
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