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

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

Build:
Build:
LAST BUILD BRANCH: fix/recompile-settings-mutation-race
DEFAULT BRANCH: master
Ran 26 May 2026 06:55PM UTC
Jobs 38
Files 164
Run time 3min
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

26 May 2026 06:50PM UTC coverage: 97.007% (+0.009%) from 96.998%
26468374615

Pull #2739

github

ericproulx
Lazy-allocate `@new_values` in `Grape::Util::BaseInheritable`

`BaseInheritable#initialize` used to eagerly allocate an empty
`@new_values = {}` per instance. Most settings layers in a typical API
only inherit from a parent and never write any *new* values of their
own, so the empty Hash was just retained dead weight.

Defer the allocation: `@new_values` starts nil, the `[]=` writers do
`(@new_values ||= {})[name] = ...`, and the read paths in
`InheritableValues#[]` / `StackableValues#[]` short-circuit on nil so
they skip the lookup entirely instead of touching an empty Hash.
`initialize_copy` skips the `.dup` when the source has no own values.

Measured on master with a small benchmark:

  Grape::Util::InheritableSetting.new ×100
    before: 1600 objects, 183.6 kB
    after:  1200 objects, 121.1 kB   (-34%)

  parent.point_in_time_copy ×100
    before: 2500 objects, 277.3 kB
    after:  1700 objects, 152.3 kB   (-45%)

The bigger win on `point_in_time_copy` matches the
`base_inheritable.rb:27` (`new_values.dup`) hot spot in the boot-time
memory profile: that line previously dup'd four empty Hashes per copy
and now skips them entirely.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Pull Request #2739: Lazy-allocate @new_values in Grape::Util::BaseInheritable

1099 of 1183 branches covered (92.9%)

Branch coverage included in aggregate %.

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

3536 of 3595 relevant lines covered (98.36%)

31353.03 hits per line

Jobs
ID Job ID Ran Files Coverage
1 run-3.3-gemfiles/rails_8_0.gemfile - 26468374615.1 26 May 2026 06:55PM UTC 164
95.72
GitHub Action Run
2 run-4.0-gemfiles/hashie.gemfile - 26468374615.2 26 May 2026 06:57PM UTC 163
62.6
GitHub Action Run
3 run-3.4-Gemfile - 26468374615.3 26 May 2026 06:56PM UTC 163
95.72
GitHub Action Run
4 run-3.2-gemfiles/rails_8_1.gemfile - 26468374615.4 26 May 2026 06:56PM UTC 164
95.77
GitHub Action Run
5 run-3.3-gemfiles/rack_3_1.gemfile - 26468374615.5 26 May 2026 06:58PM UTC 163
95.72
GitHub Action Run
6 run-3.3-gemfiles/rack_2_2.gemfile - 26468374615.6 26 May 2026 06:55PM UTC 163
95.68
GitHub Action Run
7 run-3.2-gemfiles/rack_3_2.gemfile - 26468374615.7 26 May 2026 06:55PM UTC 163
95.76
GitHub Action Run
8 run-3.3-gemfiles/rack_3_2.gemfile - 26468374615.8 26 May 2026 06:56PM UTC 163
95.72
GitHub Action Run
9 run-3.3-Gemfile - 26468374615.9 26 May 2026 06:55PM UTC 163
95.72
GitHub Action Run
10 run-4.0-gemfiles/rack_3_1.gemfile - 26468374615.10 26 May 2026 06:55PM UTC 163
95.72
GitHub Action Run
11 run-3.4-gemfiles/rack_3_1.gemfile - 26468374615.11 26 May 2026 06:56PM UTC 163
95.72
GitHub Action Run
12 run-4.0-gemfiles/rack_2_2.gemfile - 26468374615.12 26 May 2026 06:56PM UTC 163
95.68
GitHub Action Run
13 run-3.2-gemfiles/rack_3_0.gemfile - 26468374615.13 26 May 2026 06:56PM UTC 163
95.76
GitHub Action Run
14 run-4.0-gemfiles/rails_7_2.gemfile - 26468374615.14 26 May 2026 06:56PM UTC 164
95.73
GitHub Action Run
15 run-4.0-gemfiles/rails_8_1.gemfile - 26468374615.15 26 May 2026 06:56PM UTC 164
95.73
GitHub Action Run
16 run-4.0-gemfiles/grape_entity.gemfile - 26468374615.16 26 May 2026 06:58PM UTC 163
50.4
GitHub Action Run
17 run-3.4-gemfiles/rack_3_0.gemfile - 26468374615.17 26 May 2026 06:56PM UTC 163
95.72
GitHub Action Run
18 run-3.2-gemfiles/rack_3_1.gemfile - 26468374615.18 26 May 2026 06:58PM UTC 163
95.76
GitHub Action Run
19 run-3.3-gemfiles/rails_7_2.gemfile - 26468374615.19 26 May 2026 06:56PM UTC 164
95.72
GitHub Action Run
20 run-3.2-gemfiles/rails_7_2.gemfile - 26468374615.20 26 May 2026 06:58PM UTC 164
95.77
GitHub Action Run
21 run-3.2-gemfiles/rails_8_0.gemfile - 26468374615.21 26 May 2026 06:58PM UTC 164
95.77
GitHub Action Run
22 run-3.3-gemfiles/rack_3_0.gemfile - 26468374615.22 26 May 2026 06:56PM UTC 163
95.72
GitHub Action Run
23 run-4.0-gemfiles/dry_validation.gemfile - 26468374615.23 26 May 2026 06:57PM UTC 163
58.41
GitHub Action Run
24 run-3.4-gemfiles/rack_3_2.gemfile - 26468374615.24 26 May 2026 06:56PM UTC 163
95.72
GitHub Action Run
25 run-3.4-gemfiles/rails_8_0.gemfile - 26468374615.25 26 May 2026 06:58PM UTC 164
95.73
GitHub Action Run
26 run-3.2-gemfiles/rack_2_2.gemfile - 26468374615.26 26 May 2026 06:57PM UTC 163
95.72
GitHub Action Run
27 run-3.3-gemfiles/rails_8_1.gemfile - 26468374615.27 26 May 2026 06:56PM UTC 164
95.72
GitHub Action Run
28 run-4.0-Gemfile - 26468374615.28 26 May 2026 06:58PM UTC 163
95.72
GitHub Action Run
29 run-4.0-gemfiles/rack_3_0.gemfile - 26468374615.29 26 May 2026 06:57PM UTC 163
95.72
GitHub Action Run
30 run-4.0-gemfiles/multi_xml.gemfile - 26468374615.30 26 May 2026 06:57PM UTC 163
36.62
GitHub Action Run
31 run-3.4-gemfiles/rack_2_2.gemfile - 26468374615.31 26 May 2026 06:58PM UTC 163
95.68
GitHub Action Run
32 run-3.4-gemfiles/rails_8_1.gemfile - 26468374615.32 26 May 2026 06:58PM UTC 164
95.73
GitHub Action Run
33 run-4.0-gemfiles/multi_json.gemfile - 26468374615.33 26 May 2026 06:58PM UTC 163
36.62
GitHub Action Run
34 run-4.0-gemfiles/rails_8_0.gemfile - 26468374615.34 26 May 2026 06:58PM UTC 164
95.73
GitHub Action Run
35 run-4.0-gemfiles/rack_3_2.gemfile - 26468374615.35 26 May 2026 06:58PM UTC 163
95.72
GitHub Action Run
36 run-3.2-Gemfile - 26468374615.36 26 May 2026 06:58PM UTC 163
95.76
GitHub Action Run
37 run-4.0-gemfiles/grape_swagger.gemfile - 26468374615.37 26 May 2026 06:58PM UTC 163
55.37
GitHub Action Run
38 run-3.4-gemfiles/rails_7_2.gemfile - 26468374615.38 26 May 2026 06:58PM UTC 164
95.73
GitHub Action Run
Source Files on build 26468374615
  • Tree
  • List 164
  • 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 #26468374615
  • Pull Request #2739
  • PR Base - master (#26418525997)
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