mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-11-17 05:32:41 +00:00
A large write was scheduled on two clocks. The I/O thread woke the main loop once the previous wake was input_delay old. The parser then refused a chunk of at least 1KB until input_delay had passed since its first byte, and armed a timer for the rest. That first turn still painted: repaint_delay only skips a paint when nothing was parsed and the last paint is recent. The timer turn parsed the bytes and painted again right away, because a turn that parsed input ignores repaint_delay. With both delays at 1ms this was two trips, and often two paints, per large write. input_delay 0 never holds, so it did the work once and used less CPU. The I/O thread now asks the parser for one deadline, new_input_at + input_delay, and sleeps until then. A chunk under 1KB still wakes immediately, at most once per input_delay. A buffer within 16KB of full wakes immediately, which is when the parser already refuses to hold. If a frame callback or another event wakes the main loop while bytes are held, render returns without painting. The hold timer is already armed. A thumbnail still paints. A child that exits is taken off the poll set, so the hold can no longer see it. The main thread is woken when that child is queued and flush-parses its final output. A signal stays latched until that wake. signalfd is emptied on the first poll, so a later poll cannot see the same signal. Without the latch, a signal that arrived inside the delay was dropped when the next poll had no parser deadline. A scanned tail left in the buffer has its timestamp cleared. Those bytes were already looked at. They are not input waiting out input_delay. Treating a zero timestamp as ready made every later wake skip the delay. If monotonic() returns 0 at startup, the commit stores 1, so 0 stays the empty timestamp and a real chunk still gets a deadline. |
||
|---|---|---|
| .. | ||
| _static | ||
| _templates | ||
| kittens | ||
| screenshots | ||
| actions.rst | ||
| basic.rst | ||
| binary.rst | ||
| build.rst | ||
| changelog.rst | ||
| clipboard.rst | ||
| color-stack.rst | ||
| conf.py | ||
| conf.rst | ||
| custom-shaders.rst | ||
| deccara.rst | ||
| desktop-notifications.rst | ||
| dnd-protocol.rst | ||
| extract-rst-targets.py | ||
| faq.rst | ||
| file-transfer-protocol.rst | ||
| glossary.rst | ||
| graphics-protocol.rst | ||
| index.rst | ||
| installer.sh | ||
| integrations.rst | ||
| intro_vid.rst | ||
| invocation.rst | ||
| keyboard-protocol.rst | ||
| kittens_intro.rst | ||
| launch.rst | ||
| layouts.rst | ||
| Makefile | ||
| mapping.rst | ||
| marks.rst | ||
| misc-protocol.rst | ||
| multiple-cursors-protocol.rst | ||
| notifications.py | ||
| open_actions.rst | ||
| overview.rst | ||
| performance.rst | ||
| pipe.rst | ||
| pointer-shapes.rst | ||
| press-mentions.rst | ||
| protocol-extensions.rst | ||
| quake-screenshots.rst | ||
| quickstart.rst | ||
| rc_protocol.rst | ||
| remote-control.rst | ||
| requirements.txt | ||
| sessions.rst | ||
| shell-integration.rst | ||
| support.html | ||
| support.rst | ||
| text-sizing-protocol.rst | ||
| underlines.rst | ||
| unscroll.rst | ||
| wide-gamut-colors.rst | ||