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

ruby-grape / grape / 24754575829 / 4
97%
master: 97%

Build:
DEFAULT BRANCH: master
Ran 22 Apr 2026 01:02AM UTC
Files 154
Run time 5s
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:00AM UTC coverage: 49.44% (-0.05%) from 49.494%
24754575829.4

push

github

web-flow
Avoid empty-hash merges on request hot paths (#2689)

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>

198 of 1159 branches covered (17.08%)

Branch coverage included in aggregate %.

2053 of 3394 relevant lines covered (60.49%)

8.06 hits per line

Source Files on job run-4.0-gemfiles/grape_entity.gemfile - 24754575829.4
  • Tree
  • List 154
  • Changed 3
  • Source Changed 3
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Build 24754575829
  • 952a74c4 on github
  • Prev Job for on master (#24699723680.16)
  • Next Job for on master (#24754666104.32)
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