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

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

Build:
Build:
LAST BUILD BRANCH: perf/default-status-single-read
DEFAULT BRANCH: master
Ran 02 Sep 2026 09:58PM UTC
Jobs 32
Files 169
Run time 2min
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

02 Sep 2026 09:44PM UTC coverage: 96.941% (+0.001%) from 96.94%
33686818750

Pull #2892

github

ericproulx
Resolve the params builder when params are first read, not in the constructor

`Grape::Request#initialize` runs once per request, and resolved the params
builder eagerly:

    def initialize(env, build_params_with: nil)
      super(env)
      @params_builder = Grape::ParamsBuilder.params_builder_for(build_params_with || Grape.config[:param_builder])
    end

Two lookups behind that line, both on the request path:

* `Grape.config[:param_builder]` — dry-configurable's `Config#[]`, 126 ns;
* `params_builder_for` — a `key?` plus a `[]` against the registry
  `HashWithIndifferentAccess`, 200 ns together.

`@params_builder` has exactly one reader, `make_params`, which only runs when
something asks for `params`. An endpoint with no validations whose block never
mentions them — a health check, a static resource, a redirect — paid both
lookups to build an object it then dropped.

Memoize it on first use instead. `Grape.config` stays the source of truth, read
at the same point in the request as before for anything that does read params,
so a `build_with :unknown` still surfaces as a 500 during the request rather
than at mount time.

Median of 5 interleaved runs against master (Ruby 4.0.5): **+5.9%** on a
minimal versioned GET that never touches params; **+1.1%** on one with params
and validations, where the work moved rather than disappeared.

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Pull Request #2892: Resolve the params builder when params are first read, not in the constructor

1239 of 1334 branches covered (92.88%)

Branch coverage included in aggregate %.

4 of 4 new or added lines in 1 file covered. (100.0%)

3927 of 3995 relevant lines covered (98.3%)

27506.34 hits per line

Jobs
ID Job ID Ran Files Coverage
1 run-4.0-gemfiles/multi_xml.gemfile - 33686818750.1 02 Sep 2026 09:58PM UTC 168
46.97
GitHub Action Run
2 run-3.3-gemfiles/rails_8_1.gemfile - 33686818750.2 02 Sep 2026 10:01PM UTC 169
95.7
GitHub Action Run
3 run-3.4-gemfiles/rails_8_0.gemfile - 33686818750.3 02 Sep 2026 09:58PM UTC 169
95.7
GitHub Action Run
4 run-3.4-Gemfile - 33686818750.4 02 Sep 2026 10:00PM UTC 168
95.7
GitHub Action Run
5 run-4.0-gemfiles/multi_xml_0_8.gemfile - 33686818750.5 02 Sep 2026 10:01PM UTC 168
47.0
GitHub Action Run
6 run-4.0-gemfiles/dry_validation.gemfile - 33686818750.6 02 Sep 2026 09:58PM UTC 168
57.82
GitHub Action Run
7 run-3.4-gemfiles/rails_8_1.gemfile - 33686818750.7 02 Sep 2026 09:58PM UTC 169
95.7
GitHub Action Run
8 run-3.3-gemfiles/rack_3_2.gemfile - 33686818750.8 02 Sep 2026 09:58PM UTC 168
95.7
GitHub Action Run
9 run-4.0-gemfiles/rack_3_0.gemfile - 33686818750.9 02 Sep 2026 09:58PM UTC 168
95.7
GitHub Action Run
10 run-3.3-gemfiles/rack_2_2.gemfile - 33686818750.10 02 Sep 2026 09:59PM UTC 168
95.66
GitHub Action Run
11 run-4.0-gemfiles/rack_3_2.gemfile - 33686818750.11 02 Sep 2026 09:58PM UTC 168
95.7
GitHub Action Run
12 run-4.0-gemfiles/multi_json.gemfile - 33686818750.12 02 Sep 2026 09:59PM UTC 168
47.45
GitHub Action Run
13 run-4.0-gemfiles/grape_entity.gemfile - 33686818750.13 02 Sep 2026 10:00PM UTC 168
50.25
GitHub Action Run
14 run-4.0-gemfiles/multi_json_1_20.gemfile - 33686818750.14 02 Sep 2026 09:58PM UTC 168
47.49
GitHub Action Run
15 run-3.4-gemfiles/rack_3_1.gemfile - 33686818750.15 02 Sep 2026 10:01PM UTC 168
95.7
GitHub Action Run
16 run-4.0-Gemfile - 33686818750.16 02 Sep 2026 09:59PM UTC 168
95.7
GitHub Action Run
17 run-3.4-gemfiles/rails_7_2.gemfile - 33686818750.17 02 Sep 2026 09:59PM UTC 169
95.7
GitHub Action Run
18 run-3.4-gemfiles/rack_3_2.gemfile - 33686818750.18 02 Sep 2026 10:00PM UTC 168
95.7
GitHub Action Run
19 run-3.4-gemfiles/rack_2_2.gemfile - 33686818750.19 02 Sep 2026 09:58PM UTC 168
95.66
GitHub Action Run
20 run-4.0-gemfiles/grape_swagger.gemfile - 33686818750.20 02 Sep 2026 09:59PM UTC 168
55.21
GitHub Action Run
21 run-3.3-gemfiles/rails_7_2.gemfile - 33686818750.21 02 Sep 2026 10:00PM UTC 169
95.7
GitHub Action Run
22 run-4.0-gemfiles/rails_8_1.gemfile - 33686818750.22 02 Sep 2026 10:01PM UTC 169
95.7
GitHub Action Run
23 run-3.3-gemfiles/rack_3_1.gemfile - 33686818750.23 02 Sep 2026 09:59PM UTC 168
95.7
GitHub Action Run
24 run-4.0-gemfiles/rails_8_0.gemfile - 33686818750.24 02 Sep 2026 10:01PM UTC 169
95.7
GitHub Action Run
25 run-4.0-gemfiles/rails_7_2.gemfile - 33686818750.25 02 Sep 2026 10:01PM UTC 169
95.7
GitHub Action Run
26 run-3.3-Gemfile - 33686818750.26 02 Sep 2026 10:01PM UTC 168
95.7
GitHub Action Run
27 run-4.0-gemfiles/hashie.gemfile - 33686818750.27 02 Sep 2026 10:00PM UTC 168
61.79
GitHub Action Run
28 run-3.3-gemfiles/rails_8_0.gemfile - 33686818750.28 02 Sep 2026 10:01PM UTC 169
95.7
GitHub Action Run
29 run-3.3-gemfiles/rack_3_0.gemfile - 33686818750.29 02 Sep 2026 10:00PM UTC 168
95.7
GitHub Action Run
30 run-4.0-gemfiles/rack_2_2.gemfile - 33686818750.30 02 Sep 2026 10:00PM UTC 168
95.66
GitHub Action Run
31 run-4.0-gemfiles/rack_3_1.gemfile - 33686818750.31 02 Sep 2026 09:58PM UTC 168
95.7
GitHub Action Run
32 run-3.4-gemfiles/rack_3_0.gemfile - 33686818750.32 02 Sep 2026 09:58PM UTC 168
95.7
GitHub Action Run
Source Files on build 33686818750
  • Tree
  • List 169
  • Changed 2
  • Source Changed 1
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #33686818750
  • Pull Request #2892
  • PR Base - master (#33686307519)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc