points by jatoo 2 days ago | 0 comments
Doesn't the code as written potentially keep extending the deadline each time the deadline_flush is called even if nothing is written to the buffer? So long as you call the flush often enough which would depend on the work in the while loop.
Also, this:
> Where DEADLINE is something appropriate for human perception, like 100ms or so
is way off. You easily notice a hitch of one frame in 60 fps content, and this is comparable. The timer should be something like 1-10 ms. Outputting multiple lines is really fast, so even 1 ms would merge most output into a single write() call. I'd start with 1 ms and raise it if there's a strong reason, which there probably isn't.