• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Kikobeats / ua-hints / 40593647985
100%

Build:
DEFAULT BRANCH: master
Ran 27 Oct 2026 10:17PM UTC
Jobs 1
Files 1
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

27 Oct 2026 10:17PM UTC coverage: 100.0%. Remained the same
40593647985

push

github

web-flow
perf: cache hints per user agent in a bounded LRU (#24)

* perf: cache hints per user agent in a bounded LRU

Parsing dominates every call: ua-parser-js runs four getters, each
allocating a UAItem and walking its regex map (createIData + setProps +
regexes were ~70% of self time). Callers pass the same few user agents
over and over, so the parsed hints are now kept in a Map capped at 1000
entries (least recently used evicted) and a shallow copy is returned, so
callers can still mutate what they get back.

A/B, node benchmark/index.js, 5 alternating runs per side, median of
medians (node 24.16.0, arm64, load avg 7.5):

| case | base | head | delta |
|---|---|---|---|
| hints top 100 user agents | 99.6 ms | 0.4 ms | -99.6% |
| hints single user agent repeated | 128.4 ms | 1.4 ms | -98.9% |

All-miss path (20k distinct UAs): 564 ms -> 573 ms (+1.5%).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test: lock hint-cache hits, eviction, and recency

Output checks stay green if a repeat parse, a dropped eviction, or a
stale recency update slips in. Count parser constructions so those
branches fail, and treat a cached empty object as a hit.

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Cursor <cursoragent@cursor.com>

61 of 61 branches covered (100.0%)

Branch coverage included in aggregate %.

21 of 21 new or added lines in 1 file covered. (100.0%)

188 of 188 relevant lines covered (100.0%)

507.51 hits per line

Jobs
ID Job ID Ran Files Coverage
1 40593647985.1 27 Oct 2026 10:17PM UTC 1
100.0
GitHub Action Run
Source Files on build 40593647985
  • Tree
  • List 1
  • Changed 1
  • Source Changed 1
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #40593647985
  • 21811502 on github
  • Prev Build on master (#38361298437)
  • Next Build on master (#40670686908)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc