#59441 closed defect (bug) (fixed)
Use instanceof in block_has_support
Reported by: | spacedmonkey | Owned by: | spacedmonkey |
---|---|---|---|
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.
15 months 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.
15 months ago
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