[wp-trac] [WordPress Trac] #58385: Skip file_exists check for core blocks in register_block_type_from_metadata
WordPress Trac
noreply at wordpress.org
Tue Jun 13 19:41:58 UTC 2023
#58385: Skip file_exists check for core blocks in register_block_type_from_metadata
--------------------------+---------------------------
Reporter: spacedmonkey | Owner: spacedmonkey
Type: enhancement | Status: closed
Priority: high | Milestone: 6.3
Component: Editor | Version: 5.5
Severity: normal | Resolution: fixed
Keywords: has-patch | Focuses: performance
--------------------------+---------------------------
Comment (by flixos90):
After conducting some benchmarks here, I can say that the performance
difference is negligible. Doing various benchmarks with 100 runs each for
[55910] compared to the previous commit, sometimes this commit is slightly
faster, other times the previous commit is slightly faster - which means
it is due to variance, so the impact is too small to be notable. However,
even with that it's clear to tell from the change that it is beneficial.
Let's keep in mind for the future that `file_exists()` checks are
particularly expensive for when the files ''don't'' exist, based on
previous findings. Since for WP core files we know that they always exist,
that's probably why removing them didn't bring a ''notable'' performance
win. Still probably good to have done it :)
--
Ticket URL: <https://core.trac.wordpress.org/ticket/58385#comment:10>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list