Functions: Memoize `wp_normalize_path()`.
`wp_normalize_path()` is called thousands of times on a given request. This patch adds memoization via a function-local static variable. This reduces the call count to the underlying `wp_is_stream()` function, and measured in testing around a 66% cache hit rate. In testing, for a site making 4000 calls to `wp_normalize_path()`, this patch led to a reduction in runtime from 1.4 ms to 0.4 ms on the test computer. While small, this time occurs early in the hotpath of the loading WordPress. Developed in: https://github.com/WordPress/wordpress-develop/pull/10770 Discussed in: https://core.trac.wordpress.org/ticket/64538 Props dmsnell, josephscott, mreishus, westonruter. Fixes #64538. git-svn-id: https://develop.svn.wordpress.org/trunk@61857 602fd350-edb4-49c9-b593-d223f7449a82
D
Dennis Snell committed
1757a20b3284af49f199542129a7fbb292809427
Parent: 2b6cd61