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

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

Build:
Build:
LAST BUILD BRANCH: perf/build-headers-each-header
DEFAULT BRANCH: master
Ran 21 Apr 2026 12:22PM UTC
Jobs 37
Files 155
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

21 Apr 2026 12:21PM UTC coverage: 96.976% (-0.02%) from 96.994%
24722053791

Pull #2692

github

ericproulx
Replace per-request Proc in Router#transaction with a helper method

The `cascade_or_return_response` proc inside `Router#transaction` was
allocated on every request because it relied on non-local `return` to
exit the enclosing method when a non-cascading response arrived. That
behavior was doing two things at once — closing the cascading body as
a side effect, and halting transaction processing.

Split them: a plain `halt?(response)` helper returns `true` when the
response is final (and should be returned as-is), `false` when it's
either absent or cascading; closing the body lives inside the helper
as a side effect. The `transaction` method then uses explicit
early-returns for the halt case and plain assignments for the cascade
flag.

## Benchmark (1k iterations, isolated proc shape)

                      current     variant    speedup     alloc
cascading response    3.12 M/s    6.88 M/s   2.21x      1 → 0 objects
hit response (final)  3.07 M/s    9.82 M/s   3.20x      1 → 0 objects
nil response          5.07 M/s    15.7 M/s   3.10x      1 → 0 objects

Saves one proc allocation per request in the router's `transaction`
dispatch — plus 2–3x faster control flow in the cascade-decision step.

No behavior change; all 2,236 specs pass.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Pull Request #2692: Replace per-request Proc in Router#transaction with a helper

1071 of 1155 branches covered (92.73%)

Branch coverage included in aggregate %.

10 of 11 new or added lines in 1 file covered. (90.91%)

3354 of 3408 relevant lines covered (98.42%)

32194.01 hits per line

Uncovered Changes

Lines Coverage ∆ File
1
97.81
-0.66% lib/grape/router.rb
Jobs
ID Job ID Ran Files Coverage
1 run-3.4-Gemfile - 24722053791.1 21 Apr 2026 12:23PM UTC 154
95.65
GitHub Action Run
2 run-4.0-gemfiles/rails_8_0.gemfile - 24722053791.2 21 Apr 2026 12:23PM UTC 155
95.65
GitHub Action Run
3 run-4.0-gemfiles/rails_7_2.gemfile - 24722053791.3 21 Apr 2026 12:23PM UTC 155
95.65
GitHub Action Run
4 run-3.2-gemfiles/rack_3_1.gemfile - 24722053791.4 21 Apr 2026 12:22PM UTC 154
95.67
GitHub Action Run
5 run-3.2-gemfiles/rack_3_0.gemfile - 24722053791.5 21 Apr 2026 12:23PM UTC 154
95.67
GitHub Action Run
6 run-3.2-gemfiles/rails_8_1.gemfile - 24722053791.6 21 Apr 2026 12:22PM UTC 155
95.68
GitHub Action Run
7 run-3.3-gemfiles/rack_2_2.gemfile - 24722053791.7 21 Apr 2026 12:23PM UTC 154
95.58
GitHub Action Run
8 run-3.3-gemfiles/rack_3_0.gemfile - 24722053791.8 21 Apr 2026 12:22PM UTC 154
95.63
GitHub Action Run
9 run-3.2-gemfiles/rack_3_2.gemfile - 24722053791.9 21 Apr 2026 12:22PM UTC 154
95.67
GitHub Action Run
10 run-4.0-gemfiles/multi_json.gemfile - 24722053791.10 21 Apr 2026 12:23PM UTC 154
36.01
GitHub Action Run
11 run-4.0-gemfiles/dry_validation.gemfile - 24722053791.11 21 Apr 2026 12:23PM UTC 154
57.75
GitHub Action Run
12 run-4.0-gemfiles/rails_8_1.gemfile - 24722053791.12 21 Apr 2026 12:23PM UTC 155
95.65
GitHub Action Run
13 run-3.2-gemfiles/rack_2_2.gemfile - 24722053791.13 21 Apr 2026 12:22PM UTC 154
95.63
GitHub Action Run
14 run-3.4-gemfiles/rack_3_1.gemfile - 24722053791.14 21 Apr 2026 12:23PM UTC 154
95.65
GitHub Action Run
15 run-3.2-gemfiles/rails_8_0.gemfile - 24722053791.15 21 Apr 2026 12:23PM UTC 155
95.68
GitHub Action Run
16 run-3.4-gemfiles/rack_3_2.gemfile - 24722053791.16 21 Apr 2026 12:23PM UTC 154
95.65
GitHub Action Run
17 run-3.3-gemfiles/rack_3_2.gemfile - 24722053791.17 21 Apr 2026 12:22PM UTC 154
95.63
GitHub Action Run
18 run-4.0-Gemfile - 24722053791.18 21 Apr 2026 12:23PM UTC 154
95.65
GitHub Action Run
19 run-3.3-gemfiles/rails_8_0.gemfile - 24722053791.19 21 Apr 2026 12:23PM UTC 155
95.63
GitHub Action Run
20 run-3.4-gemfiles/rails_8_0.gemfile - 24722053791.20 21 Apr 2026 12:22PM UTC 155
95.65
GitHub Action Run
21 run-4.0-gemfiles/rack_2_2.gemfile - 24722053791.21 21 Apr 2026 12:23PM UTC 154
95.61
GitHub Action Run
22 run-4.0-gemfiles/rack_3_0.gemfile - 24722053791.22 21 Apr 2026 12:23PM UTC 154
95.65
GitHub Action Run
23 run-3.3-Gemfile - 24722053791.23 21 Apr 2026 12:22PM UTC 154
95.63
GitHub Action Run
24 run-4.0-gemfiles/grape_entity.gemfile - 24722053791.24 21 Apr 2026 12:23PM UTC 154
49.47
GitHub Action Run
25 run-4.0-gemfiles/rack_3_2.gemfile - 24722053791.25 21 Apr 2026 12:23PM UTC 154
95.65
GitHub Action Run
26 run-4.0-gemfiles/hashie.gemfile - 24722053791.26 21 Apr 2026 12:23PM UTC 154
62.43
GitHub Action Run
27 run-3.4-gemfiles/rails_7_2.gemfile - 24722053791.27 21 Apr 2026 12:23PM UTC 155
95.65
GitHub Action Run
28 run-3.3-gemfiles/rails_8_1.gemfile - 24722053791.28 21 Apr 2026 12:23PM UTC 155
95.63
GitHub Action Run
29 run-3.4-gemfiles/rails_8_1.gemfile - 24722053791.29 21 Apr 2026 12:23PM UTC 155
95.65
GitHub Action Run
30 run-3.4-gemfiles/rack_2_2.gemfile - 24722053791.30 21 Apr 2026 12:22PM UTC 154
95.61
GitHub Action Run
31 run-4.0-gemfiles/rack_3_1.gemfile - 24722053791.31 21 Apr 2026 12:23PM UTC 154
95.65
GitHub Action Run
32 run-3.3-gemfiles/rack_3_1.gemfile - 24722053791.32 21 Apr 2026 12:22PM UTC 154
95.63
GitHub Action Run
33 run-4.0-gemfiles/multi_xml.gemfile - 24722053791.33 21 Apr 2026 12:23PM UTC 154
36.01
GitHub Action Run
34 run-3.2-gemfiles/rails_7_2.gemfile - 24722053791.34 21 Apr 2026 12:23PM UTC 155
95.68
GitHub Action Run
35 run-3.3-gemfiles/rails_7_2.gemfile - 24722053791.35 21 Apr 2026 12:23PM UTC 155
95.63
GitHub Action Run
36 run-3.2-Gemfile - 24722053791.36 21 Apr 2026 12:22PM UTC 154
95.67
GitHub Action Run
37 run-3.4-gemfiles/rack_3_0.gemfile - 24722053791.37 21 Apr 2026 12:22PM UTC 154
95.65
GitHub Action Run
Source Files on build 24722053791
  • Tree
  • List 155
  • 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 #24722053791
  • Pull Request #2692
  • PR Base - master (#24699723680)
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