[wp-trac] [WordPress Trac] #59450: Initialize $url variable later in get_bloginfo()

WordPress Trac noreply at wordpress.org
Tue Sep 26 13:07:47 UTC 2023


#59450: Initialize $url variable later in get_bloginfo()
--------------------------+--------------------------
 Reporter:  Cybr          |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  6.5
Component:  General       |     Version:  2.3
 Severity:  minor         |  Resolution:
 Keywords:  has-patch     |     Focuses:  performance
--------------------------+--------------------------

Comment (by Cybr):

 The `1e4` iterations are not part of the benchmark but the warmup. I found
 that the website shows inconsistent numbers, probably due to the way
 `hrtime()` interacts with the server or how it lazy loads PCRE -- I cannot
 tell. If you flip the warmup tests, the second will always be slower
 during -- everything thereafter is indicative of real-world performance. I
 should exclude those from the output in the future to alleviate confusion
 about this quirk.

 The point I'm making about not writing to variables is that the entire
 codebase is trying to write variables before reading them. This often
 happens needlessly, also in `apply_filters()`, albeit obscure:
 https://wordpress.slack.com/archives/C02RQBWTW/p1695251506451989.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/59450#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list