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

dunglas / go-urlpattern / 24667373104
92%

Build:
DEFAULT BRANCH: main
Ran 20 Apr 2026 12:48PM 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 12:48PM UTC coverage: 91.865% (+0.05%) from 91.82%
24667373104

push

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{} (renamed
  to specialSchemeSet since the value is now a set, not an ordered list)
  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
  gated on specialSchemeSet membership, so user-added DefaultPorts
  entries cannot silently trigger special-scheme behaviour. The
  processedInit protocol is lowercased before the check because in
  "pattern" mode processProtocolForInit does not canonicalize, and the
  protocol component is later compiled with canonicalizeProtocol which
  lowercases — so a mixed-case literal like "HTTP" should behave as
  "http" for port defaulting.

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

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

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

1502 of 1635 relevant lines covered (91.87%)

1122.56 hits per line

Jobs
ID Job ID Ran Files Coverage
1 24667373104.1 20 Apr 2026 12:48PM UTC 6
91.87
GitHub Action Run
Source Files on build 24667373104
  • Tree
  • List 6
  • Changed 1
  • Source Changed 0
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 8af4f1ef on github
  • Prev Build on main (#24663752132)
  • Next Build on main (#24677587846)
  • 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