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

ruby-grape / grape / 24754755957 / 33

Build:
DEFAULT BRANCH: master
Ran 22 Apr 2026 01:07AM UTC
Files 154
Run time 4s
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

22 Apr 2026 01:06AM UTC coverage: 95.677% (+0.003%) from 95.674%
24754755957.33

push

github

web-flow
Precompute prefix list in Versioner::Path (#2691)

`Versioner::Path#before` built `[mount_path, Grape::Router.normalize_path(prefix)]`
on every request and iterated it, filtering nil/empty/'/' entries with a guard
clause on each element. Both `mount_path` and `prefix` are fixed at mount time,
so this work is redundant.

Memoize a pre-filtered `@prefixes` array in `initialize` (the middleware dup in
`Middleware::Base#call` shallow-copies ivars, so the frozen array is shared
across request dups for free). The per-request loop simplifies to
`if path_info.start_with?(path)`.

  current                    1.09 M i/s, 80KB / 2k objects
  variant A (memoize normalize) 1.34 M i/s, 80KB / 2k objects
  variant B (memoize list)   2.61 M i/s, 40KB / 1k objects  (2.38x faster, 2x fewer)

Shipping variant B.

No behavior change; all 2,236 specs pass.

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

1051 of 1159 branches covered (90.68%)

Branch coverage included in aggregate %.

3309 of 3398 relevant lines covered (97.38%)

1007.41 hits per line

Source Files on job run-3.4-Gemfile - 24754755957.33
  • Tree
  • List 154
  • Changed 1
  • Source Changed 1
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Build 24754755957
  • f2ef8619 on github
  • Prev Job for on master (#24754666104.20)
  • Next Job for on master (#24754841764.8)
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