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

ruby-grape / grape / 24754666104 / 13
97%
master: 97%

Build:
DEFAULT BRANCH: master
Ran 22 Apr 2026 01:04AM UTC
Files 154
Run time 6s
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:03AM UTC coverage: 95.652% (+0.001%) from 95.651%
24754666104.13

push

github

web-flow
Return frozen EMPTY array from StackableValues on miss (#2690)

`StackableValues#[]` is the accessor behind `namespace_stackable[key]` —
called multiple times per request (five filter phases, plus ad-hoc
settings lookups). When neither `inherited_values` nor `new_values`
have an entry for the key, the old `return new_value || []` allocated
a fresh empty array on every miss.

Introduce a frozen `EMPTY` singleton and return it in the miss branch.
Saves two short-lived empty-array allocations per request in the
realistic shape (some filters set, some not) and up to five in the
worst case.

One caller (`Endpoint#initialize`) stored `namespace_stackable[:validations]`
directly into `route[:saved_validations]` by reference, and later
`.concat`'d parent validations into it via `inherit_settings`. With the
stackable now able to return a frozen array, that mutation would
`FrozenError`. Dup at capture so the route keeps its own mutable list —
good hygiene regardless of this change.

Realistic (3 keys populated, 2 absent):
  current: 2.01 M i/s, 80B / 2 objects allocated
  variant: 2.19 M i/s, 0B / 0 objects allocated

Worst case (all 5 absent):
  current: 2.18 M i/s, 200B / 5 objects
  variant: 2.49 M i/s, 0B / 0 objects  (1.14x faster)

No behavior change; all 2,236 specs pass.

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

1052 of 1161 branches covered (90.61%)

Branch coverage included in aggregate %.

3304 of 3393 relevant lines covered (97.38%)

1011.21 hits per line

Source Files on job run-3.3-gemfiles/rack_3_0.gemfile - 24754666104.13
  • Tree
  • List 154
  • Changed 2
  • Source Changed 2
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Build 24754666104
  • 66aadadf on github
  • Prev Job for on master (#24754575829.9)
  • Next Job for on master (#24754755957.9)
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