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

dunglas / go-urlpattern / 24663595320
92%
main: 92%

Build:
Build:
LAST BUILD BRANCH: chore/lint-fixes
DEFAULT BRANCH: main
Ran 20 Apr 2026 11:18AM UTC
Jobs 1
Files 6
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

20 Apr 2026 11:18AM UTC coverage: 91.835% (+0.02%) from 91.82%
24663595320

Pull #7

github

dunglas
perf: cache special-scheme flag and switch scheme checks to map lookups

- Call protocolComponentMatchesSpecialScheme() once per New() and reuse
  the result for both the hostname and pathname branches instead of
  matching the component regex against the five special schemes twice.
- Replace specialSchemeList with a single map[string]struct{} so the
  per-component lookups in processHostnameForInit and processPathnameForInit
  are O(1). protocolComponentMatchesSpecialScheme just iterates the map
  keys, since order is irrelevant when the loop returns on the first hit.
- Collapse the port-defaulting loop into a direct DefaultPorts lookup,
  which already keys the same five schemes.

~5-10%% reduction in ns/op on New() across pattern benchmarks.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Pull Request #7: perf: cache special-scheme flag and use a map for scheme lookups

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

25 existing lines in 1 file now uncovered.

1496 of 1629 relevant lines covered (91.84%)

1125.4 hits per line

Coverage Regressions

Lines Coverage ∆ File
25
94.0
0.04% urlpattern.go
Jobs
ID Job ID Ran Files Coverage
1 24663595320.1 20 Apr 2026 11:18AM UTC 6
91.84
GitHub Action Run
Source Files on build 24663595320
  • Tree
  • List 6
  • Changed 1
  • Source Changed 0
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Pull Request #7
  • PR Base - main (#24663455582)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc