amphtml icon indicating copy to clipboard operation
amphtml copied to clipboard

We might not need to cache parsed URLs at all

Open alanorozco opened this issue 4 years ago • 3 comments

#31594 removes the parsed URL cache on module builds. This is because URL() without cache performs similarly to using <a> with a result cache.

The cache implementation takes about ~250B of a compressed build.

This explores whether we require a cache for <a> as shipped previously on nomodule builds.

Hit rate on real documents

Documents mostly hover on the 65%-75% range.

Methodology / Results

image

Cache performance at different hit rates

Benchmark / Results

  • The cache performs better only for hit rates over around 95%. On Firefox it barely performs better in this range.
  • The cache performs worse in most cases (see "dip" in the middle.)

Chrome

image

Safari

image

Firefox

image

alanorozco avatar Jan 15 '21 17:01 alanorozco

Thank for the in-depth analysis. Worth taking this to a deep dive to share the methodology more?

kristoferbaxter avatar Jan 15 '21 17:01 kristoferbaxter

Love how deep you went here! Whats the next step? Remove the cache?

samouri avatar Jan 26 '21 20:01 samouri

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jul 19 '25 08:07 stale[bot]