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

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

Build:
Build:
LAST BUILD BRANCH: perf/build-headers-each-header
DEFAULT BRANCH: master
Ran 22 Apr 2026 12:58AM 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

22 Apr 2026 12:57AM UTC coverage: 96.998% (+0.004%) from 96.994%
24754486154

Pull #2689

github

ericproulx
Avoid empty-hash merges on request hot paths

Three `|| {}` patterns on the per-request path allocated an empty Hash
and handed it to a merge that produced a shallow copy of the left-hand
side — pure waste. Guard the merge when the right-hand side is absent
or empty instead.

When a route has no path placeholders (or none captured), `route.params`
returns an empty Hash (or nil). The old code did
`args.merge(route_params || {})`, allocating `{}` and then a new hash
identical to `args` on every matched static route.

`grape_routing_args` falls back to `{}` when env has no routing args.
`deep_merge!` on `{}` is a walking no-op. Skip the call entirely when
routing_args is empty.

`(body || {}).merge(key => representation)` — when no body is set
(the common case), this allocated `{}` only to merge one key into it.
Build the one-key hash directly.

process_route, no route_params (static path, common case):
  old: 4.48 M i/s, 480 objects allocated / 1k calls
  new: 8.31 M i/s, 160 objects allocated / 1k calls  (1.85x faster, 3x fewer)

process_route, empty {} route_params:
  old: 5.16 M i/s, 320 objects / 1k calls
  new: 8.02 M i/s, 160 objects / 1k calls  (1.55x faster, 2x fewer)

process_route, real route_params: within noise (unchanged path).

No behavior change; all 2,236 specs pass.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Pull Request #2689: Avoid empty-hash merges on request hot paths

1077 of 1161 branches covered (92.76%)

Branch coverage included in aggregate %.

5 of 5 new or added lines in 3 files covered. (100.0%)

3350 of 3403 relevant lines covered (98.44%)

32233.81 hits per line

Jobs
ID Job ID Ran Files Coverage
1 run-3.2-gemfiles/rails_8_0.gemfile - 24754486154.1 22 Apr 2026 12:58AM UTC 155
95.7
GitHub Action Run
2 run-4.0-gemfiles/grape_entity.gemfile - 24754486154.2 22 Apr 2026 12:58AM UTC 154
49.44
GitHub Action Run
3 run-3.2-gemfiles/rails_8_1.gemfile - 24754486154.3 22 Apr 2026 12:58AM UTC 155
95.7
GitHub Action Run
4 run-3.4-gemfiles/rack_3_1.gemfile - 24754486154.4 22 Apr 2026 12:58AM UTC 154
95.67
GitHub Action Run
5 run-4.0-gemfiles/rack_3_0.gemfile - 24754486154.5 22 Apr 2026 12:58AM UTC 154
95.67
GitHub Action Run
6 run-4.0-gemfiles/rack_3_1.gemfile - 24754486154.6 22 Apr 2026 12:58AM UTC 154
95.67
GitHub Action Run
7 run-4.0-gemfiles/rails_8_1.gemfile - 24754486154.7 22 Apr 2026 12:59AM UTC 155
95.68
GitHub Action Run
8 run-3.4-Gemfile - 24754486154.8 22 Apr 2026 12:58AM UTC 154
95.67
GitHub Action Run
9 run-3.4-gemfiles/rails_8_1.gemfile - 24754486154.9 22 Apr 2026 12:58AM UTC 155
95.68
GitHub Action Run
10 run-3.3-gemfiles/rack_2_2.gemfile - 24754486154.10 22 Apr 2026 12:59AM UTC 154
95.61
GitHub Action Run
11 run-3.3-gemfiles/rails_7_2.gemfile - 24754486154.11 22 Apr 2026 12:58AM UTC 155
95.66
GitHub Action Run
12 run-3.2-gemfiles/rack_3_0.gemfile - 24754486154.12 22 Apr 2026 12:58AM UTC 154
95.7
GitHub Action Run
13 run-3.3-gemfiles/rack_3_0.gemfile - 24754486154.13 22 Apr 2026 12:58AM UTC 154
95.65
GitHub Action Run
14 run-3.4-gemfiles/rails_7_2.gemfile - 24754486154.14 22 Apr 2026 12:58AM UTC 155
95.68
GitHub Action Run
15 run-4.0-gemfiles/rails_8_0.gemfile - 24754486154.15 22 Apr 2026 12:58AM UTC 155
95.68
GitHub Action Run
16 run-3.3-gemfiles/rack_3_1.gemfile - 24754486154.16 22 Apr 2026 12:58AM UTC 154
95.65
GitHub Action Run
17 run-4.0-gemfiles/multi_xml.gemfile - 24754486154.17 22 Apr 2026 12:58AM UTC 154
35.95
GitHub Action Run
18 run-3.3-gemfiles/rack_3_2.gemfile - 24754486154.18 22 Apr 2026 12:59AM UTC 154
95.65
GitHub Action Run
19 run-4.0-gemfiles/rack_2_2.gemfile - 24754486154.19 22 Apr 2026 12:58AM UTC 154
95.63
GitHub Action Run
20 run-4.0-gemfiles/rack_3_2.gemfile - 24754486154.20 22 Apr 2026 12:59AM UTC 154
95.67
GitHub Action Run
21 run-3.2-gemfiles/rails_7_2.gemfile - 24754486154.21 22 Apr 2026 12:58AM UTC 155
95.7
GitHub Action Run
22 run-3.2-Gemfile - 24754486154.22 22 Apr 2026 12:58AM UTC 154
95.7
GitHub Action Run
23 run-4.0-gemfiles/hashie.gemfile - 24754486154.23 22 Apr 2026 12:59AM UTC 154
62.49
GitHub Action Run
24 run-3.4-gemfiles/rack_3_2.gemfile - 24754486154.24 22 Apr 2026 12:59AM UTC 154
95.67
GitHub Action Run
25 run-3.2-gemfiles/rack_3_1.gemfile - 24754486154.25 22 Apr 2026 12:58AM UTC 154
95.7
GitHub Action Run
26 run-4.0-gemfiles/rails_7_2.gemfile - 24754486154.26 22 Apr 2026 12:59AM UTC 155
95.68
GitHub Action Run
27 run-4.0-gemfiles/multi_json.gemfile - 24754486154.27 22 Apr 2026 12:58AM UTC 154
35.95
GitHub Action Run
28 run-3.3-gemfiles/rails_8_0.gemfile - 24754486154.28 22 Apr 2026 12:58AM UTC 155
95.66
GitHub Action Run
29 run-3.2-gemfiles/rack_3_2.gemfile - 24754486154.29 22 Apr 2026 12:58AM UTC 154
95.7
GitHub Action Run
30 run-3.3-gemfiles/rails_8_1.gemfile - 24754486154.30 22 Apr 2026 12:58AM UTC 155
95.66
GitHub Action Run
31 run-4.0-Gemfile - 24754486154.31 22 Apr 2026 12:58AM UTC 154
95.67
GitHub Action Run
32 run-3.2-gemfiles/rack_2_2.gemfile - 24754486154.32 22 Apr 2026 12:58AM UTC 154
95.65
GitHub Action Run
33 run-3.4-gemfiles/rails_8_0.gemfile - 24754486154.33 22 Apr 2026 12:59AM UTC 155
95.68
GitHub Action Run
34 run-3.4-gemfiles/rack_2_2.gemfile - 24754486154.34 22 Apr 2026 12:58AM UTC 154
95.63
GitHub Action Run
35 run-4.0-gemfiles/dry_validation.gemfile - 24754486154.35 22 Apr 2026 12:58AM UTC 154
57.79
GitHub Action Run
36 run-3.4-gemfiles/rack_3_0.gemfile - 24754486154.36 22 Apr 2026 12:58AM UTC 154
95.67
GitHub Action Run
37 run-3.3-Gemfile - 24754486154.37 22 Apr 2026 12:58AM UTC 154
95.65
GitHub Action Run
Source Files on build 24754486154
  • Tree
  • List 155
  • Changed 3
  • Source Changed 3
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #24754486154
  • Pull Request #2689
  • 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