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

ruby-grape / grape / 26721499467 / 17
97%
master: 97%

Build:
Build:
LAST BUILD BRANCH: fix/variant-collection-coercer-to-s
DEFAULT BRANCH: master
Ran 31 May 2026 06:57PM UTC
Files 165
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

31 May 2026 06:56PM UTC coverage: 95.647% (-0.02%) from 95.662%
26721499467.17

Pull #2752

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>
Pull Request #2752: Skip per-request instrumentation work when no subscribers are listening

1088 of 1201 branches covered (90.59%)

Branch coverage included in aggregate %.

3504 of 3600 relevant lines covered (97.33%)

968.42 hits per line

Source Files on job run-3.4-gemfiles/rack_3_0.gemfile - 26721499467.17
  • 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 26721499467
  • d2dab206 on github
  • Prev Job for on perf/instrument-only-when-subscribed (#26681995871.29)
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