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

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!

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.