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

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

Build:
Build:
LAST BUILD BRANCH: fix/recompile-settings-mutation-race
DEFAULT BRANCH: master
Ran 23 May 2026 05:36PM UTC
Jobs 38
Files 164
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

23 May 2026 05:35PM UTC coverage: 96.986% (+0.009%) from 96.977%
26339194043

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

1100 of 1185 branches covered (92.83%)

Branch coverage included in aggregate %.

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

3534 of 3593 relevant lines covered (98.36%)

31349.81 hits per line

Jobs
ID Job ID Ran Files Coverage
1 run-3.3-Gemfile - 26339194043.1 23 May 2026 05:36PM UTC 163
95.7
GitHub Action Run
2 run-3.2-gemfiles/rack_2_2.gemfile - 26339194043.2 23 May 2026 05:36PM UTC 163
95.7
GitHub Action Run
3 run-3.2-gemfiles/rack_3_1.gemfile - 26339194043.3 23 May 2026 05:36PM UTC 163
95.74
GitHub Action Run
4 run-3.2-gemfiles/rails_8_1.gemfile - 26339194043.4 23 May 2026 05:36PM UTC 164
95.75
GitHub Action Run
5 run-3.2-gemfiles/rails_8_0.gemfile - 26339194043.5 23 May 2026 05:36PM UTC 164
95.75
GitHub Action Run
6 run-4.0-gemfiles/rails_8_1.gemfile - 26339194043.6 23 May 2026 05:36PM UTC 164
95.7
GitHub Action Run
7 run-3.2-gemfiles/rack_3_2.gemfile - 26339194043.7 23 May 2026 05:36PM UTC 163
95.74
GitHub Action Run
8 run-4.0-Gemfile - 26339194043.8 23 May 2026 05:36PM UTC 163
95.7
GitHub Action Run
9 run-4.0-gemfiles/hashie.gemfile - 26339194043.9 23 May 2026 05:36PM UTC 163
62.54
GitHub Action Run
10 run-4.0-gemfiles/multi_xml.gemfile - 26339194043.10 23 May 2026 05:35PM UTC 163
36.56
GitHub Action Run
11 run-3.4-gemfiles/rails_7_2.gemfile - 26339194043.11 23 May 2026 05:36PM UTC 164
95.7
GitHub Action Run
12 run-4.0-gemfiles/grape_swagger.gemfile - 26339194043.12 23 May 2026 05:35PM UTC 163
55.31
GitHub Action Run
13 run-3.3-gemfiles/rails_7_2.gemfile - 26339194043.13 23 May 2026 05:36PM UTC 164
95.7
GitHub Action Run
14 run-3.2-gemfiles/rack_3_0.gemfile - 26339194043.14 23 May 2026 05:36PM UTC 163
95.74
GitHub Action Run
15 run-3.3-gemfiles/rack_2_2.gemfile - 26339194043.15 23 May 2026 05:36PM UTC 163
95.66
GitHub Action Run
16 run-4.0-gemfiles/rails_8_0.gemfile - 26339194043.16 23 May 2026 05:36PM UTC 164
95.7
GitHub Action Run
17 run-4.0-gemfiles/grape_entity.gemfile - 26339194043.17 23 May 2026 05:36PM UTC 163
50.34
GitHub Action Run
18 run-3.3-gemfiles/rack_3_2.gemfile - 26339194043.18 23 May 2026 05:36PM UTC 163
95.7
GitHub Action Run
19 run-3.2-Gemfile - 26339194043.19 23 May 2026 05:36PM UTC 163
95.74
GitHub Action Run
20 run-3.4-Gemfile - 26339194043.20 23 May 2026 05:36PM UTC 163
95.7
GitHub Action Run
21 run-3.4-gemfiles/rails_8_0.gemfile - 26339194043.21 23 May 2026 05:36PM UTC 164
95.7
GitHub Action Run
22 run-4.0-gemfiles/rack_3_0.gemfile - 26339194043.22 23 May 2026 05:36PM UTC 163
95.7
GitHub Action Run
23 run-4.0-gemfiles/multi_json.gemfile - 26339194043.23 23 May 2026 05:36PM UTC 163
36.56
GitHub Action Run
24 run-3.4-gemfiles/rack_2_2.gemfile - 26339194043.24 23 May 2026 05:36PM UTC 163
95.66
GitHub Action Run
25 run-3.2-gemfiles/rails_7_2.gemfile - 26339194043.25 23 May 2026 05:36PM UTC 164
95.75
GitHub Action Run
26 run-3.3-gemfiles/rails_8_0.gemfile - 26339194043.26 23 May 2026 05:36PM UTC 164
95.7
GitHub Action Run
27 run-3.4-gemfiles/rack_3_2.gemfile - 26339194043.27 23 May 2026 05:37PM UTC 163
95.7
GitHub Action Run
28 run-4.0-gemfiles/rack_3_2.gemfile - 26339194043.28 23 May 2026 05:36PM UTC 163
95.7
GitHub Action Run
29 run-3.4-gemfiles/rails_8_1.gemfile - 26339194043.29 23 May 2026 05:36PM UTC 164
95.7
GitHub Action Run
30 run-4.0-gemfiles/rack_3_1.gemfile - 26339194043.30 23 May 2026 05:36PM UTC 163
95.7
GitHub Action Run
31 run-4.0-gemfiles/rails_7_2.gemfile - 26339194043.31 23 May 2026 05:36PM UTC 164
95.7
GitHub Action Run
32 run-3.3-gemfiles/rack_3_1.gemfile - 26339194043.32 23 May 2026 05:36PM UTC 163
95.7
GitHub Action Run
33 run-4.0-gemfiles/dry_validation.gemfile - 26339194043.33 23 May 2026 05:36PM UTC 163
58.35
GitHub Action Run
34 run-3.4-gemfiles/rack_3_0.gemfile - 26339194043.34 23 May 2026 05:36PM UTC 163
95.7
GitHub Action Run
35 run-4.0-gemfiles/rack_2_2.gemfile - 26339194043.35 23 May 2026 05:36PM UTC 163
95.66
GitHub Action Run
36 run-3.3-gemfiles/rails_8_1.gemfile - 26339194043.36 23 May 2026 05:36PM UTC 164
95.7
GitHub Action Run
37 run-3.4-gemfiles/rack_3_1.gemfile - 26339194043.37 23 May 2026 05:36PM UTC 163
95.7
GitHub Action Run
38 run-3.3-gemfiles/rack_3_0.gemfile - 26339194043.38 23 May 2026 05:36PM UTC 163
95.7
GitHub Action Run
Source Files on build 26339194043
  • 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 #26339194043
  • Pull Request #2739
  • PR Base - master (#26292056269)
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