ampproject / ampproject/amphtml
We might not need to cache parsed URLs at all
- Dominant language
- JavaScript
- Stars
- 14.9k
- Forks
- 4.1k
- PR merge metrics
- No merged PRs in 30d
Description
#31594 removes the parsed URL cache on `module` builds. This is because `URL()` without cache performs similarly to using `` with a result cache.
The cache implementation takes about `~250B` of a compressed build.
This explores whether we require a cache for `` as shipped previously on `nomodule` builds.
## Hit rate on real documents
Documents mostly hover on the 65%-75% range.
[**Methodology**](https://gist.github.com/alanorozco/3c6e65546cc0441c2b0e4771f7decc29) / [**Results**](https://docs.google.com/spreadsheets/d/1p8MaV660NS2SlN5xgY0mlGqqLUZfxNV7Jh7ntiWt8sA/edit?resourcekey=0-4EJx844chhDQCxqphjjKkw#gid=0)

## Cache performance at different hit rates
[**Benchmark**](https://jsbench.me/06kis3hhcd/1) / [**Results**](https://docs.google.com/spreadsheets/d/1Bv952eeBvjmQNVzSn39SQHp1EYJNA985P53x_DcUoR4/edit?resourcekey=0-6b60xJzTOtUJqXxVVBSFkQ#gid=0)
- **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

### Safari

### Firefox

Contributor guide
Assessment
This issue has not been assessed yet.