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

ruby-grape / grape / 26494474144 / 8
97%
master: 97%

Build:
DEFAULT BRANCH: master
Ran 27 May 2026 06:21AM UTC
Files 165
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:20AM UTC coverage: 95.703% (+0.004%) from 95.699%
26494474144.8

push

github

web-flow
Lazy-allocate `@api_class` and `@point_in_time_copies` on InheritableSetting (#2740)

`InheritableSetting#initialize` used to eagerly allocate both fields up
front. Neither is touched on most settings layers:

- `@api_class` is only written by external code (e.g. plugins) via
  `setting.api_class[:k] = v`; nothing in `lib/` writes to it.
- `@point_in_time_copies` only fills up on settings that get cloned via
  `point_in_time_copy` — typically the API-class-level setting, not the
  per-endpoint copies that make up the bulk of allocations at boot.

Switch both to memoizing readers (`@x ||= …`), drop the eager init, and
rewrite the `inherit_from` propagation loop to access the ivar directly
with `&.each` so the no-copies path doesn't allocate the Array just to
iterate zero elements.

Measured against master:

  Grape::Util::InheritableSetting.new × 100
    before: 1600 objects, 183.6 kB
    after:  1400 objects, 164.1 kB   (-11%)

Stacks with #2739 (lazy `@new_values`) for compounded boot-time savings.

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

1078 of 1189 branches covered (90.66%)

Branch coverage included in aggregate %.

3510 of 3605 relevant lines covered (97.36%)

976.03 hits per line

Source Files on job run-3.3-gemfiles/rails_8_0.gemfile - 26494474144.8
  • Tree
  • List 165
  • Changed 1
  • Source Changed 1
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Build 26494474144
  • 9e23b68a on github
  • Prev Job for on master (#26494147065.20)
  • Next Job for on master (#26494640124.24)
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