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

ruby-grape / grape / 26494147065 / 21
97%
master: 97%

Build:
DEFAULT BRANCH: master
Ran 27 May 2026 06:12AM UTC
Files 164
Run time 13s
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

27 May 2026 06:11AM UTC coverage: 62.586% (+0.1%) from 62.476%
26494147065.21

push

github

web-flow
Lazy-allocate `@new_values` in `Grape::Util::BaseInheritable` (#2739)

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

383 of 1185 branches covered (32.32%)

Branch coverage included in aggregate %.

2613 of 3602 relevant lines covered (72.54%)

7.87 hits per line

Source Files on job run-4.0-gemfiles/hashie.gemfile - 26494147065.21
  • 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 Build 26494147065
  • ff888ff1 on github
  • Prev Job for on master (#26493796179.22)
  • Next Job for on master (#26494474144.22)
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