[wp-trac] [WordPress Trac] #64538: memoize wp_normalize_path

WordPress Trac noreply at wordpress.org
Thu Jan 22 22:20:19 UTC 2026


#64538: memoize wp_normalize_path
--------------------------------------+---------------------
 Reporter:  josephscott               |       Owner:  (none)
     Type:  defect (bug)              |      Status:  new
 Priority:  normal                    |   Milestone:  7.0
Component:  General                   |     Version:
 Severity:  normal                    |  Resolution:
 Keywords:  has-patch has-unit-tests  |     Focuses:
--------------------------------------+---------------------

Comment (by josephscott):

 Thanks to some additional ideas from Matthew Reishus I experimented with
 various approaches to caching here.  After a number of iterations I
 settled on a segmented cache approach.  This avoids bringing in a whole
 new class to do LRU, while still keeping a cap on the size & memory.

 This segmented approach still got a 66% cache hit ratio on my large scale
 test site, with a cap of 100 entries for each segment, but the memory
 usage was only ~35KB.  Seems like a good trade off for an additional two
 dozen lines or so.

 I have updated https://github.com/WordPress/wordpress-
 develop/pull/10770/changes to use this segmented approach.

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


More information about the wp-trac mailing list