# Offline renders: optional flag to skip pre-roll sleeps (macOS timer coalescing makes them very slow)

**URL:** <https://forum.juce.com/t/offline-renders-optional-flag-to-skip-pre-roll-sleeps-macos-timer-coalescing-makes-them-very-slow/69597>\
**Category:** Tracktion Engine\
**Created:** [September 26, 2026, 8:51pm UTC](https://forum.juce.com/t/offline-renders-optional-flag-to-skip-pre-roll-sleeps-macos-timer-coalescing-makes-them-very-slow/69597 "2026-09-26T20:51:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rogerneel](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/rogerneel/32/22543_2.png) [@rogerneel](https://forum.juce.com/u/rogerneel)\
**Post date:** [September 26, 2026, 8:51pm UTC](https://forum.juce.com/t/offline-renders-optional-flag-to-skip-pre-roll-sleeps-macos-timer-coalescing-makes-them-very-slow/69597/1 "2026-09-26T20:51:12Z")

</div>

Hey there, I’m new here, but it looks like you can’t take PRs on GitHub. I’m just starting to run the libraries and ran into an issue within tmux/herdr in my terminal session.

Issue:  
NodeRenderContext::renderNextBlock sleeps for each pre-roll block (~0.5 s total) and for 1 ms every 100 blocks. On macOS, a process started from a detached tmux-style server has no app coalition, so it gets background timer coalescing with up to 100 ms of slack per sleep. Measured on develop @ 2f5e50b: 20 × 10 ms sleeps take ~850 ms instead of ~245 ms. For us, a 22 s render went from 1.75 s to 3.9 s because of this. An NSProcessInfo latency-critical activity doesn’t help.

Suggestion:  
An opt-in Renderer::Parameters::sleepWhileRendering (default true, so nothing changes). When it’s off, the pre-roll doesn’t sleep and the periodic sleep (1) becomes std::this\_thread::yield(). It’s a 10-line change and I’m happy to share the diff. With it, our output is unchanged to within 7 LSB (24-bit).

Happy to help or give more info!

---

<div class="post-metadata">

**Author:** ![dave96](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/dave96/32/8487_2.png) [@dave96](https://forum.juce.com/u/dave96)\
**Post date:** [September 26, 2026, 9:12pm UTC](https://forum.juce.com/t/offline-renders-optional-flag-to-skip-pre-roll-sleeps-macos-timer-coalescing-makes-them-very-slow/69597/2 "2026-09-26T21:12:49Z")

</div>

I’m not sure those sleeps need to be there at all anymore unless you’re using the real-time render option. They’re probably remnants of when single-core machines were still common. Can you open an Issue on GitHub as that’s where we keep track of these things now. I’ll do some investigation and hopefully come to a resolution.
