measure how long diff llm clients block on io for sync vs streaming calls
on devbox:
./worker_blocking_analysis.sh ruby <test_script><test_script>:
- openai-stream.rb
- openai-sync.rb
- stripe-stream-poll.rb
run the prompt Write a haiku about OpenAI. on gpt-5 three times in series.
measure wall clock time and subtract user+sys cpu time to calculate blocked time on network i/o.
validate blocked time using strace being spent on epoll_wait and futex.
- sync
- native streaming
- poll-based streaming
| Client | Sync Calls (blocked on i/o) | Streaming Calls (blocked on i/o) |
|---|---|---|
| OpenAI Native SDK | 95.09% | 97.36% |
| Stripe Ruby Client (Poll) | N/A | 79.19% |