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

ruby-grape / grape / 33382102206
97%
master: 97%

Build:
Build:
LAST BUILD BRANCH: perf/skip-default-version-pattern
DEFAULT BRANCH: master
Ran 31 Aug 2026 10:22AM UTC
Jobs 32
Files 169
Run time 2min
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

31 Aug 2026 10:22AM UTC coverage: 96.978%. Remained the same
33382102206

push

github

ericproulx
Test the path-normalizer fast path without a regexp

`Grape::Util::PathNormalizer.call` runs twice per request — once in
`Versioner::Path#before`, once in `Router#call` — and almost always returns the
path untouched. The guard that decides this matched `%r{%|//}`, which is one
alternation over the whole string:

    return path if path.start_with?('/') && !(path.end_with?('/') || path.match?(%r{%|//}))

Two `String#include?` calls answer the same question and stay in C without
building a match. Measured in one process, on the predicate alone:

    realistic path (41 chars)    regexp 313 ns   ->   include? 217 ns   1.44x
    short path (13 chars)        regexp 194 ns   ->   include? 181 ns   1.07x

The gain grows with path length, which is the direction real APIs go. No
allocation change either way.

One behavioural difference worth naming: `String#include?` does not validate
encoding, while `String#match?` does. A PATH_INFO holding an invalid byte
sequence used to raise `ArgumentError` here; it now passes through and raises
the same `ArgumentError` from `Router#match?` instead, one frame later. A path
served by a forward-match route (a bare Rack app mounted with `mount`), which
never reaches a regexp, now goes through rather than raising. Nothing
percent-encodes to invalid UTF-8, so this needs a client sending raw bytes in
the request target.

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>

1238 of 1330 branches covered (93.08%)

Branch coverage included in aggregate %.

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

3897 of 3965 relevant lines covered (98.28%)

27164.23 hits per line

Jobs
ID Job ID Ran Files Coverage
1 run-3.4-gemfiles/rack_2_2.gemfile - 33382102206.1 31 Aug 2026 10:23AM UTC 168
95.69
GitHub Action Run
2 run-3.3-gemfiles/rails_8_0.gemfile - 33382102206.2 31 Aug 2026 10:23AM UTC 169
95.73
GitHub Action Run
3 run-4.0-gemfiles/grape_entity.gemfile - 33382102206.3 31 Aug 2026 10:24AM UTC 168
50.1
GitHub Action Run
4 run-3.3-gemfiles/rack_2_2.gemfile - 33382102206.4 31 Aug 2026 10:24AM UTC 168
95.69
GitHub Action Run
5 run-3.4-gemfiles/rack_3_0.gemfile - 33382102206.5 31 Aug 2026 10:22AM UTC 168
95.73
GitHub Action Run
6 run-4.0-gemfiles/dry_validation.gemfile - 33382102206.6 31 Aug 2026 10:25AM UTC 168
57.8
GitHub Action Run
7 run-3.3-gemfiles/rack_3_2.gemfile - 33382102206.7 31 Aug 2026 10:22AM UTC 168
95.73
GitHub Action Run
8 run-3.4-gemfiles/rack_3_2.gemfile - 33382102206.8 31 Aug 2026 10:25AM UTC 168
95.73
GitHub Action Run
9 run-4.0-gemfiles/rack_3_1.gemfile - 33382102206.9 31 Aug 2026 10:24AM UTC 168
95.73
GitHub Action Run
10 run-3.3-gemfiles/rails_7_2.gemfile - 33382102206.10 31 Aug 2026 10:23AM UTC 169
95.73
GitHub Action Run
11 run-3.4-gemfiles/rails_8_1.gemfile - 33382102206.11 31 Aug 2026 10:24AM UTC 169
95.73
GitHub Action Run
12 run-4.0-gemfiles/rack_2_2.gemfile - 33382102206.12 31 Aug 2026 10:24AM UTC 168
95.69
GitHub Action Run
13 run-3.4-gemfiles/rack_3_1.gemfile - 33382102206.13 31 Aug 2026 10:23AM UTC 168
95.73
GitHub Action Run
14 run-4.0-gemfiles/rails_8_1.gemfile - 33382102206.14 31 Aug 2026 10:25AM UTC 169
95.73
GitHub Action Run
15 run-4.0-gemfiles/multi_json.gemfile - 33382102206.15 31 Aug 2026 10:26AM UTC 168
47.4
GitHub Action Run
16 run-4.0-gemfiles/multi_xml_0_8.gemfile - 33382102206.16 31 Aug 2026 10:23AM UTC 168
46.83
GitHub Action Run
17 run-4.0-gemfiles/rack_3_2.gemfile - 33382102206.17 31 Aug 2026 10:25AM UTC 168
95.73
GitHub Action Run
18 run-3.3-Gemfile - 33382102206.18 31 Aug 2026 10:25AM UTC 168
95.73
GitHub Action Run
19 run-3.4-gemfiles/rails_8_0.gemfile - 33382102206.19 31 Aug 2026 10:24AM UTC 169
95.73
GitHub Action Run
20 run-3.3-gemfiles/rails_8_1.gemfile - 33382102206.20 31 Aug 2026 10:23AM UTC 169
95.73
GitHub Action Run
21 run-4.0-gemfiles/rack_3_0.gemfile - 33382102206.21 31 Aug 2026 10:24AM UTC 168
95.73
GitHub Action Run
22 run-4.0-gemfiles/rails_8_0.gemfile - 33382102206.22 31 Aug 2026 10:24AM UTC 169
95.73
GitHub Action Run
23 run-4.0-gemfiles/hashie.gemfile - 33382102206.23 31 Aug 2026 10:25AM UTC 168
61.64
GitHub Action Run
24 run-3.4-Gemfile - 33382102206.24 31 Aug 2026 10:23AM UTC 168
95.73
GitHub Action Run
25 run-4.0-gemfiles/rails_7_2.gemfile - 33382102206.25 31 Aug 2026 10:25AM UTC 169
95.73
GitHub Action Run
26 run-3.4-gemfiles/rails_7_2.gemfile - 33382102206.26 31 Aug 2026 10:23AM UTC 169
95.73
GitHub Action Run
27 run-4.0-gemfiles/grape_swagger.gemfile - 33382102206.27 31 Aug 2026 10:26AM UTC 168
55.19
GitHub Action Run
28 run-3.3-gemfiles/rack_3_1.gemfile - 33382102206.28 31 Aug 2026 10:25AM UTC 168
95.73
GitHub Action Run
29 run-3.3-gemfiles/rack_3_0.gemfile - 33382102206.29 31 Aug 2026 10:23AM UTC 168
95.73
GitHub Action Run
30 run-4.0-Gemfile - 33382102206.30 31 Aug 2026 10:23AM UTC 168
95.73
GitHub Action Run
31 run-4.0-gemfiles/multi_json_1_20.gemfile - 33382102206.31 31 Aug 2026 10:25AM UTC 168
47.44
GitHub Action Run
32 run-4.0-gemfiles/multi_xml.gemfile - 33382102206.32 31 Aug 2026 10:25AM UTC 168
46.8
GitHub Action Run
Source Files on build 33382102206
  • Tree
  • List 169
  • 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 #33382102206
  • d54b18bf on github
  • Prev Build on master (#33322439088)
  • Next Build on perf/path-normalizer-fast-path (#33382229399)
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