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

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

Build:
Build:
LAST BUILD BRANCH: chore/lint-fixes
DEFAULT BRANCH: main
Ran 20 Apr 2026 11:32AM 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:32AM UTC coverage: 91.865% (+0.05%) from 91.82%
24664158264

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{} (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>
Pull Request #7: perf: cache special-scheme flag and use a map for scheme lookups

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

1502 of 1635 relevant lines covered (91.87%)

1122.59 hits per line

Jobs
ID Job ID Ran Files Coverage
1 24664158264.1 20 Apr 2026 11:32AM UTC 6
91.87
GitHub Action Run
Source Files on build 24664158264
  • 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 (#24663752132)
  • 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