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

ruby-grape / grape / 26785176904 / 25
97%
master: 97%

Build:
Build:
LAST BUILD BRANCH: perf/lazy-response-cookies
DEFAULT BRANCH: master
Ran 01 Jun 2026 10:12PM UTC
Files 165
Run time 8s
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 Jun 2026 10:11PM UTC coverage: 95.649% (+0.001%) from 95.648%
26785176904.25

Pull #2757

github

ericproulx
Build the cookie jar only on use and drop its deferral Proc

Two related steps that make the response-cookie path lazy at the request
boundary:

- `build_response_cookies` runs on every request and went through
  `cookies` -> `request.cookies`, materializing the `Grape::Cookies` jar
  even when the handler never touched a cookie. Gate it on a new
  `Grape::Request#cookies?` predicate (true only once the jar exists),
  so a cookie-free request allocates no jar at all.

- With the jar now built only when a cookie is actually read or written,
  its `-> { rack_cookies }` deferral Proc no longer earns its keep: any
  access immediately forces the parse, and a write (`[]=`) always did.
  Parse `rack_cookies` eagerly in the constructor and replace the
  `is_a?(Proc)` lazy reader with a plain `attr_reader`, dropping the
  closure allocation and the per-access branch.

The `ActiveSupport::HashWithIndifferentAccess` wrapping is unchanged --
it backs Grape's string/symbol-indifferent cookie access.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Pull Request #2757: Build the cookie jar only on use and drop its deferral Proc

1090 of 1203 branches covered (90.61%)

Branch coverage included in aggregate %.

3504 of 3600 relevant lines covered (97.33%)

966.18 hits per line

Source Files on job run-3.4-Gemfile - 26785176904.25
  • Tree
  • List 165
  • Changed 3
  • Source Changed 3
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Build 26785176904
  • c2b0cf59 on github
  • Prev Job for on perf/lazy-response-cookies (#26755015790.7)
  • Next Job for on perf/lazy-response-cookies (#26847976081.19)
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