[wp-trac] [WordPress Trac] #56636: Performance: duplicate use of realpath()

WordPress Trac noreply at wordpress.org
Fri Sep 23 08:38:10 UTC 2022


#56636: Performance: duplicate use of realpath()
--------------------------+--------------------
 Reporter:  aristath      |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  6.1
Component:  General       |    Version:  trunk
 Severity:  normal        |   Keywords:
  Focuses:  performance   |
--------------------------+--------------------
 While running Xdebug profiling with webgring in WP-Core, I noticed that
 `realpath()` is getting called too many times and costs a lot of time.
 After some examination, I found that the `register_block_style_handle()`
 function call `realpath` to set a `$style_path_norm` variable, and then a
 few lines below that, sets a `$style_file` variable with the exact same
 value, recalculating things and re-running `realpath`.

 This is a simple bugfix and saves some performance. More details and
 screenshots in the PR

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/56636>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list