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

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

Build:
Build:
LAST BUILD BRANCH: perf/build-headers-each-header
DEFAULT BRANCH: master
Ran 20 Apr 2026 11:40PM 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:39PM UTC coverage: 96.932% (+0.001%) from 96.931%
24695994796

Pull #2690

github

ericproulx
Return frozen EMPTY array from StackableValues on miss

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

## Benchmark (1k iterations, 5-key probe per iteration)

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>
Pull Request #2690: Return frozen EMPTY array from StackableValues on miss

1071 of 1157 branches covered (92.57%)

Branch coverage included in aggregate %.

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

3352 of 3406 relevant lines covered (98.41%)

32205.86 hits per line

Jobs
ID Job ID Ran Files Coverage
1 run-3.2-gemfiles/rack_3_2.gemfile - 24695994796.1 20 Apr 2026 11:41PM UTC 154
95.63
GitHub Action Run
2 run-3.2-gemfiles/rack_2_2.gemfile - 24695994796.2 20 Apr 2026 11:41PM UTC 154
95.59
GitHub Action Run
3 run-4.0-gemfiles/rails_8_0.gemfile - 24695994796.3 20 Apr 2026 11:42PM UTC 155
95.61
GitHub Action Run
4 run-3.4-gemfiles/rack_3_0.gemfile - 24695994796.4 20 Apr 2026 11:41PM UTC 154
95.61
GitHub Action Run
5 run-4.0-gemfiles/rack_3_2.gemfile - 24695994796.5 20 Apr 2026 11:40PM UTC 154
95.61
GitHub Action Run
6 run-3.2-gemfiles/rails_8_0.gemfile - 24695994796.6 20 Apr 2026 11:41PM UTC 155
95.63
GitHub Action Run
7 run-4.0-gemfiles/multi_xml.gemfile - 24695994796.7 20 Apr 2026 11:42PM UTC 154
36.01
GitHub Action Run
8 run-3.4-gemfiles/rails_8_0.gemfile - 24695994796.8 20 Apr 2026 11:41PM UTC 155
95.61
GitHub Action Run
9 run-3.3-Gemfile - 24695994796.9 20 Apr 2026 11:41PM UTC 154
95.58
GitHub Action Run
10 run-3.3-gemfiles/rails_8_0.gemfile - 24695994796.10 20 Apr 2026 11:41PM UTC 155
95.59
GitHub Action Run
11 run-3.3-gemfiles/rails_7_2.gemfile - 24695994796.11 20 Apr 2026 11:41PM UTC 155
95.59
GitHub Action Run
12 run-3.2-gemfiles/rails_7_2.gemfile - 24695994796.12 20 Apr 2026 11:41PM UTC 155
95.63
GitHub Action Run
13 run-3.4-Gemfile - 24695994796.13 20 Apr 2026 11:41PM UTC 154
95.61
GitHub Action Run
14 run-4.0-gemfiles/hashie.gemfile - 24695994796.14 20 Apr 2026 11:41PM UTC 154
62.48
GitHub Action Run
15 run-3.4-gemfiles/rails_7_2.gemfile - 24695994796.15 20 Apr 2026 11:41PM UTC 155
95.61
GitHub Action Run
16 run-3.3-gemfiles/rails_8_1.gemfile - 24695994796.16 20 Apr 2026 11:41PM UTC 155
95.59
GitHub Action Run
17 run-3.2-gemfiles/rails_8_1.gemfile - 24695994796.17 20 Apr 2026 11:41PM UTC 155
95.63
GitHub Action Run
18 run-3.2-gemfiles/rack_3_0.gemfile - 24695994796.18 20 Apr 2026 11:41PM UTC 154
95.63
GitHub Action Run
19 run-3.4-gemfiles/rack_3_2.gemfile - 24695994796.19 20 Apr 2026 11:41PM UTC 154
95.61
GitHub Action Run
20 run-4.0-gemfiles/rack_3_0.gemfile - 24695994796.20 20 Apr 2026 11:41PM UTC 154
95.61
GitHub Action Run
21 run-3.2-gemfiles/rack_3_1.gemfile - 24695994796.21 20 Apr 2026 11:41PM UTC 154
95.63
GitHub Action Run
22 run-3.3-gemfiles/rack_2_2.gemfile - 24695994796.22 20 Apr 2026 11:40PM UTC 154
95.54
GitHub Action Run
23 run-4.0-gemfiles/rack_2_2.gemfile - 24695994796.23 20 Apr 2026 11:41PM UTC 154
95.56
GitHub Action Run
24 run-3.2-Gemfile - 24695994796.24 20 Apr 2026 11:41PM UTC 154
95.63
GitHub Action Run
25 run-4.0-gemfiles/rails_8_1.gemfile - 24695994796.25 20 Apr 2026 11:41PM UTC 155
95.61
GitHub Action Run
26 run-4.0-gemfiles/rack_3_1.gemfile - 24695994796.26 20 Apr 2026 11:42PM UTC 154
95.61
GitHub Action Run
27 run-3.4-gemfiles/rack_2_2.gemfile - 24695994796.27 20 Apr 2026 11:41PM UTC 154
95.56
GitHub Action Run
28 run-3.4-gemfiles/rails_8_1.gemfile - 24695994796.28 20 Apr 2026 11:42PM UTC 155
95.61
GitHub Action Run
29 run-3.3-gemfiles/rack_3_0.gemfile - 24695994796.29 20 Apr 2026 11:41PM UTC 154
95.58
GitHub Action Run
30 run-4.0-gemfiles/grape_entity.gemfile - 24695994796.30 20 Apr 2026 11:41PM UTC 154
49.45
GitHub Action Run
31 run-3.4-gemfiles/rack_3_1.gemfile - 24695994796.31 20 Apr 2026 11:41PM UTC 154
95.61
GitHub Action Run
32 run-4.0-gemfiles/multi_json.gemfile - 24695994796.32 20 Apr 2026 11:41PM UTC 154
36.01
GitHub Action Run
33 run-3.3-gemfiles/rack_3_2.gemfile - 24695994796.33 20 Apr 2026 11:42PM UTC 154
95.58
GitHub Action Run
34 run-3.3-gemfiles/rack_3_1.gemfile - 24695994796.34 20 Apr 2026 11:41PM UTC 154
95.58
GitHub Action Run
35 run-4.0-gemfiles/rails_7_2.gemfile - 24695994796.35 20 Apr 2026 11:42PM UTC 155
95.61
GitHub Action Run
36 run-4.0-Gemfile - 24695994796.36 20 Apr 2026 11:41PM UTC 154
95.61
GitHub Action Run
37 run-4.0-gemfiles/dry_validation.gemfile - 24695994796.37 20 Apr 2026 11:42PM UTC 154
57.8
GitHub Action Run
Source Files on build 24695994796
  • Tree
  • List 155
  • Changed 2
  • Source Changed 2
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #24695994796
  • Pull Request #2690
  • 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