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

ruby-grape / grape / 26721434661 / 30
97%
master: 97%

Build:
Build:
LAST BUILD BRANCH: chore/raise-dependency-lower-bounds
DEFAULT BRANCH: master
Ran 31 May 2026 06:54PM UTC
Files 165
Run time 7s
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

31 May 2026 06:53PM UTC coverage: 95.604% (-0.02%) from 95.623%
26721434661.30

push

github

ericproulx
Skip per-request instrumentation work when no subscribers are listening

Grape fires up to six ActiveSupport::Notifications.instrument calls per
request (endpoint run / render / run_validators / run_filters and
format_response). Each builds a payload Hash and enters the notification
machinery on every request, even when nothing is subscribed to the event.

Guard each emission behind ActiveSupport::Notifications.notifier.listening?
via a small private instrument_<event> method on the owning class. With no
subscriber the block runs directly, skipping the payload Hash and the
instrument dispatch; the block is forwarded anonymously so nothing extra is
allocated unless a subscriber is present. Behaviour is unchanged when a
subscriber exists - same events, same payloads.

Saves one Hash allocation per emitted event (-6 allocations/request on an
endpoint with before/after filters and params), ~+4.6% median throughput
under YJIT on that endpoint; scales with events emitted per request.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

1087 of 1203 branches covered (90.36%)

Branch coverage included in aggregate %.

3502 of 3597 relevant lines covered (97.36%)

969.17 hits per line

Source Files on job run-3.3-gemfiles/rack_2_2.gemfile - 26721434661.30
  • Tree
  • List 165
  • Changed 2
  • Source Changed 2
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Build 26721434661
  • 4ecad51b on github
  • Prev Job for on perf/instrument-only-when-subscribed (#26680646984.26)
  • Next Job for on perf/instrument-only-when-subscribed (#26721499467.1)
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