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

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

Build:
Build:
LAST BUILD BRANCH: perf/build-headers-each-header
DEFAULT BRANCH: master
Ran 20 Apr 2026 11:21PM 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

20 Apr 2026 11:20PM UTC coverage: 96.936% (+0.005%) from 96.931%
24695398154

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.

## Router#process_route

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.

## Request#make_params

`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.

## DSL::Entity#present (keyed form)

`(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.

## Benchmarks

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 1163 branches covered (92.61%)

Branch coverage included in aggregate %.

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

3352 of 3406 relevant lines covered (98.41%)

32211.17 hits per line

Jobs
ID Job ID Ran Files Coverage
1 run-3.4-gemfiles/rails_8_0.gemfile - 24695398154.1 20 Apr 2026 11:22PM UTC 155
95.62
GitHub Action Run
2 run-3.3-Gemfile - 24695398154.2 20 Apr 2026 11:21PM UTC 154
95.59
GitHub Action Run
3 run-4.0-gemfiles/rack_3_2.gemfile - 24695398154.3 20 Apr 2026 11:22PM UTC 154
95.61
GitHub Action Run
4 run-3.2-gemfiles/rack_3_1.gemfile - 24695398154.4 20 Apr 2026 11:21PM UTC 154
95.64
GitHub Action Run
5 run-3.4-Gemfile - 24695398154.5 20 Apr 2026 11:21PM UTC 154
95.61
GitHub Action Run
6 run-3.3-gemfiles/rails_7_2.gemfile - 24695398154.6 20 Apr 2026 11:21PM UTC 155
95.59
GitHub Action Run
7 run-3.2-gemfiles/rails_7_2.gemfile - 24695398154.7 20 Apr 2026 11:22PM UTC 155
95.64
GitHub Action Run
8 run-3.4-gemfiles/rack_3_0.gemfile - 24695398154.8 20 Apr 2026 11:21PM UTC 154
95.61
GitHub Action Run
9 run-4.0-gemfiles/rack_3_1.gemfile - 24695398154.9 20 Apr 2026 11:21PM UTC 154
95.61
GitHub Action Run
10 run-4.0-gemfiles/rack_2_2.gemfile - 24695398154.10 20 Apr 2026 11:22PM UTC 154
95.57
GitHub Action Run
11 run-3.3-gemfiles/rails_8_1.gemfile - 24695398154.11 20 Apr 2026 11:21PM UTC 155
95.59
GitHub Action Run
12 run-3.2-gemfiles/rails_8_1.gemfile - 24695398154.12 20 Apr 2026 11:21PM UTC 155
95.64
GitHub Action Run
13 run-4.0-gemfiles/rails_8_1.gemfile - 24695398154.13 20 Apr 2026 11:22PM UTC 155
95.62
GitHub Action Run
14 run-4.0-gemfiles/rails_7_2.gemfile - 24695398154.14 20 Apr 2026 11:22PM UTC 155
95.62
GitHub Action Run
15 run-3.4-gemfiles/rack_3_2.gemfile - 24695398154.15 20 Apr 2026 11:22PM UTC 154
95.61
GitHub Action Run
16 run-4.0-gemfiles/rails_8_0.gemfile - 24695398154.16 20 Apr 2026 11:22PM UTC 155
95.62
GitHub Action Run
17 run-4.0-gemfiles/dry_validation.gemfile - 24695398154.17 20 Apr 2026 11:22PM UTC 154
57.81
GitHub Action Run
18 run-3.2-gemfiles/rack_2_2.gemfile - 24695398154.18 20 Apr 2026 11:21PM UTC 154
95.59
GitHub Action Run
19 run-4.0-gemfiles/multi_xml.gemfile - 24695398154.19 20 Apr 2026 11:22PM UTC 154
35.94
GitHub Action Run
20 run-4.0-gemfiles/rack_3_0.gemfile - 24695398154.20 20 Apr 2026 11:22PM UTC 154
95.61
GitHub Action Run
21 run-4.0-gemfiles/hashie.gemfile - 24695398154.21 20 Apr 2026 11:22PM UTC 154
62.48
GitHub Action Run
22 run-3.4-gemfiles/rails_7_2.gemfile - 24695398154.22 20 Apr 2026 11:22PM UTC 155
95.62
GitHub Action Run
23 run-3.3-gemfiles/rack_3_0.gemfile - 24695398154.23 20 Apr 2026 11:21PM UTC 154
95.59
GitHub Action Run
24 run-3.2-gemfiles/rails_8_0.gemfile - 24695398154.24 20 Apr 2026 11:21PM UTC 155
95.64
GitHub Action Run
25 run-4.0-gemfiles/grape_entity.gemfile - 24695398154.25 20 Apr 2026 11:22PM UTC 154
49.41
GitHub Action Run
26 run-3.2-gemfiles/rack_3_0.gemfile - 24695398154.26 20 Apr 2026 11:21PM UTC 154
95.64
GitHub Action Run
27 run-3.4-gemfiles/rack_2_2.gemfile - 24695398154.27 20 Apr 2026 11:21PM UTC 154
95.57
GitHub Action Run
28 run-3.4-gemfiles/rack_3_1.gemfile - 24695398154.28 20 Apr 2026 11:21PM UTC 154
95.61
GitHub Action Run
29 run-3.3-gemfiles/rack_3_1.gemfile - 24695398154.29 20 Apr 2026 11:22PM UTC 154
95.59
GitHub Action Run
30 run-3.3-gemfiles/rack_2_2.gemfile - 24695398154.30 20 Apr 2026 11:21PM UTC 154
95.55
GitHub Action Run
31 run-4.0-gemfiles/multi_json.gemfile - 24695398154.31 20 Apr 2026 11:22PM UTC 154
35.94
GitHub Action Run
32 run-3.3-gemfiles/rack_3_2.gemfile - 24695398154.32 20 Apr 2026 11:21PM UTC 154
95.59
GitHub Action Run
33 run-3.3-gemfiles/rails_8_0.gemfile - 24695398154.33 20 Apr 2026 11:22PM UTC 155
95.59
GitHub Action Run
34 run-3.2-Gemfile - 24695398154.34 20 Apr 2026 11:21PM UTC 154
95.64
GitHub Action Run
35 run-3.2-gemfiles/rack_3_2.gemfile - 24695398154.35 20 Apr 2026 11:21PM UTC 154
95.64
GitHub Action Run
36 run-3.4-gemfiles/rails_8_1.gemfile - 24695398154.36 20 Apr 2026 11:21PM UTC 155
95.62
GitHub Action Run
37 run-4.0-Gemfile - 24695398154.37 20 Apr 2026 11:22PM UTC 154
95.61
GitHub Action Run
Source Files on build 24695398154
  • 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 #24695398154
  • Pull Request #2689
  • PR Base - master (#24693877550)
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