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

bolshakov / stoplight / 14419258696
100%

Build:
DEFAULT BRANCH: master
Ran 12 Apr 2025 11:41AM UTC
Jobs 3
Files 22
Run time 1min
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

12 Apr 2025 11:41AM UTC coverage: 100.0%. Remained the same
14419258696

push

github

web-flow
Optimize notification locking for improved responsiveness (#293)

The original implementation of `#with_deduplicated_notification` in `Memory` data store was locking the
entire data store via MonitorMixin's `synchronize` while yielding to notifiers. Even though notifications
are rare in our system, when they do happen, they could potentially block other critical operations.

This change introduces a focused optimization:

1. Separate the notification lock from the main data store lock by using a dedicated `Thread::Mutex` specifically for notifications
2. Move the yield operation outside of the synchronized block to prevent blocking other operations during notification processing
3. Add benchmarks to measure and verify the performance characteristics

Under simulated high contention (10 resource names, 16 threads with 0.001s operations):
- Original implementation: ~36.7s real time
- Optimized implementation: ~2.8s real time (13x faster)

Even under low contention scenarios, which better represent our production environment, the optimized version showed similar improvements in responsiveness.

While notifications are infrequent in our system, the impact of blocking the entire data store during a
notification can still affect system responsiveness. This change ensures that when notifications do occur,
they don't interfere with other critical operations that might be happening simultaneously.

The optimization maintains the same semantics and thread safety guarantees while significantly reducing
the potential for lock contention during these occasional but important notification events.

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

427 of 427 relevant lines covered (100.0%)

252.34 hits per line

Jobs
ID Job ID Ran Files Coverage
1 ruby-3.4 - 14419258696.1 12 Apr 2025 11:41AM UTC 22
100.0
GitHub Action Run
2 ruby-3.2 - 14419258696.2 12 Apr 2025 11:41AM UTC 22
100.0
GitHub Action Run
3 ruby-3.3 - 14419258696.3 12 Apr 2025 11:41AM UTC 22
100.0
GitHub Action Run
Source Files on build 14419258696
  • Tree
  • List 22
  • Changed 1
  • Source Changed 0
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • eb74e12b on github
  • Prev Build on master (#14405612323)
  • Next Build on master (#14439395417)
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

© 2025 Coveralls, Inc