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

ruby-grape / grape / 25224889023 / 5
97%
master: 97%

Build:
Build:
LAST BUILD BRANCH: fix/recompile-settings-mutation-race
DEFAULT BRANCH: master
Ran 01 May 2026 05:29PM UTC
Files 154
Run time 6s
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

01 May 2026 05:27PM UTC coverage: 95.679% (+0.02%) from 95.656%
25224889023.5

Pull #2696

github

ericproulx
Reduce per-request allocations on the request hot path

A bundle of small, behavior-preserving cleanups that drop allocations
or chain walks from every request. Stable values (filter buckets,
versioner options, etc.) are computed once at compile/init and read via
`attr_reader`, instead of being re-resolved through nested hash lookups
on every request.

* `Endpoint#run`: precompute filter buckets (befores, before_validations,
  after_validations, afters, finallies) and `:build_params_with` once
  in `compile!`; replace the dynamic `define_method` accessor block
  with `attr_reader`; remove a dead `header 'Allow', header['Allow']`
  self-assignment.

* `Versioner::Base`: replace the two `define_method`-per-key blocks
  (top-level and `version_options` keys) with `attr_reader` plus ivars
  precomputed in `initialize`. Per-request `pattern`/`prefix`/`vendor`/
  `strict`/etc. lookups now hit attr loads. `DEFAULT_OPTIONS`,
  `attr_reader` list, and ivar assignments alphabetized; redundant
  `version_options` reader dropped.

* `Middleware::Error` / `Middleware::Formatter`: same `options[...]`
  -> `attr_reader` migration. All option keys live in `DEFAULT_OPTIONS`
  (alphabetized), assigned to ivars in `initialize`, read via attr at
  request time. Drop the dead `rescue_subclasses` middleware key (the
  per-handler `:rescue_options` hash carries it, not the middleware
  options).

* `Middleware::Base`: freeze `@options` after `merge_default_options` --
  immutable once initialized. One spec adjusted to construct a fresh
  middleware instead of mutating `subject.options[...]`.

* `ErrorFormatter::Base.call`: third argument is now the
  `rescue_options` hash directly (not the wrapping middleware options).
  Top-level `:backtrace` / `:original_exception` reads instead of
  `dig(:rescue_options, ...)`.

* `Request#make_params`: skip the `except(:version, :route_info)` hash
  allocation in the common case where routing args contain only the
  known keys.

* `Vali... (continued)
Pull Request #2696: Reduce per-request allocations on the request hot path

1051 of 1159 branches covered (90.68%)

Branch coverage included in aggregate %.

3333 of 3423 relevant lines covered (97.37%)

1015.62 hits per line

Source Files on job run-3.4-gemfiles/rack_3_1.gemfile - 25224889023.5
  • Tree
  • List 154
  • Changed 10
  • Source Changed 10
  • Coverage Changed 6
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Build 25224889023
  • e56c3673 on github
  • Prev Job for on perf/request-hot-path-polish (#25137726391.26)
  • Next Job for on perf/request-hot-path-polish (#25224938021.10)
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