One of the changes made to improve Ghostty IO throughput was to introduce a new IO gather thread, bringing our total thread count to 3 per terminal instance. Under heavy IO load, this keeps our VT processing working at nearly full bandwidth without stalls.
Previously, Ghostty's IO thread (since 2023!) followed this general shape:
read_pty(); exit_if_quitting(); process_data()
The problem is that under heavy load, the pty kernel-side buffer becomes full, blocking the writer (e.g. TUI program). So while Ghostty was in `process_data`, the rest of the world just stalled. Then when we got back to `read_pty`, we'd read the next chunk (a syscall), and while we're paying the syscall cost, Ghostty isn't processing VT data.
Additionally, on macOS and Linux, the kernel only gives a max of 1024 bytes out of a `read()` on a pty (even if the buffer on either side is larger). So, when you `read_pty`, you get 1024 bytes and get back to blocking.
I tried reading from the pty until EAGAIN to fill a buffer but it actually didn't move the needle much cause the major slowdown issue were the stalls on eithe rside.
So the gather thread instead sits in a loop of reading from the pty and filling a set of preallocated buffers. If a read is less than 1024 bytes we assume we're not under any write pressure and dispatch immediately. This preserves latency.
But when we read a full 1024 byte we assume we are under write pressure and sit in a CPU spin loop (the context switch on a blocking read is higher than the time it takes the writer side to write to the pty). We do this until we get less than 1024 bytes or a timeout of 3 nanoseconds passes or the buffer is full (64KB). Then we dispatch.
As a result, under heavy load, Ghostty is effectively processing data through our VT processor at 100% efficiency so IO is fully bottlenecked there, for now.
This was all discovered in concert with LLM usage, which helped pull direct kernel source (XNU + Linux) to validate assumptions, write minimal harnesses in C to quickly verify, and rubber duck some of my approaches.
Show more
SOMEONE SPENT A YEAR BUILDING A MAC APP THAT REPLACES TEN SEPARATE UTILITIES, AND IT LIVES IN YOUR NOTCH
macos scatters all the little in between tasks across a dozen different apps.
this pulls all of it into one native app that lives in the empty space (the notch).
its called droppy, and its modular, you switch on only the pieces you want:
> a file tray to stage files from anywhere, then convert, compress, zip or share them and drag them back out
> a full clipboard manager with tags, favorites and color/hex recognition
> screenshots with ocr, scrolling capture, an editor and one click background removal
> a notch mini player with a live audio visualizer, lyrics and lock screen controls
> inline imessage and whatsapp replies straight from the notification
> a spotlight style launcher, voice transcription, window snapping, even a quick terminal
one native app doing the job of ten, built by one person
Show more
In 2014, Robin Williams was 63 and living in Marin County, California, when a strange medical mystery began tightening around him. Parkinson’s had a name, but his fear, confusion, sleepless nights, and mental fog still did not.
At home, Susan Schneider Williams was watching the man the world knew for laughter slowly become trapped inside symptoms nobody could fully explain. The comic genius was still there, but something hidden kept changing the rules.
The clues did not arrive like one clear warning. They came scattered. Stomach pain. Insomnia. A poor sense of smell. Anxiety that felt too sharp. Then came moments that scared Susan because they did not match the Robin she knew. He could be present one minute, then caught in fear the next. Susan later wrote, “By wintertime, problems with paranoia, delusions and looping, insomnia, memory, and high cortisol levels, just to name a few, were settling in hard.”
That sentence became one of the most painful pieces of the puzzle. Robin Williams had spent decades turning speed, memory, emotion, and chaos into art. His mind was part of his magic. On stage, he could jump between voices like flipping channels inside his own brain. In “Mrs. Doubtfire” (1993), he made families laugh through pain. In “Good Will Hunting” (1997), he made silence feel heavy. But inside his own body, something was now stealing the very tools that made him Robin.
The fear was not normal stress. Susan had lived beside him. She knew the difference between worry and something deeper. Later, she said, “But Robin would remain in a heightened state of fear and anxiety that led to irrational paranoia. It was painful to watch.” That was the nightmare. He was not simply sad. He was frightened by changes he could feel but could not name.
By May 2014, doctors gave him a Parkinson’s disease diagnosis. It explained some things. His left hand had a tremor. His body had slowed. His face sometimes looked less expressive. His movement was changing. A diagnosis should have brought comfort, but for Robin it felt incomplete. He asked whether he had Alzheimer’s. He asked about dementia. He asked about schizophrenia. The answer was no, but the questions themselves were clues.
That is where the mystery becomes darker. The diagnosis was not fake, but it was not the full picture. Parkinson’s explained the movement symptoms. It did not fully explain the paranoia, confusion, insomnia, panic, and strange mental changes. Robin was being treated for what doctors could see clearly. The real enemy was still hiding behind overlapping symptoms.
Susan watched him struggle with things that once came naturally. Lines became harder. Confidence cracked. Sleep disappeared. Some days carried flashes of the old Robin, then the fog would return. He knew something was wrong, and that knowledge hurt him. It was like a brilliant machine was short-circuiting from the inside while everyone outside kept searching for the right switch.
On August 11, 2014, Robin Williams died by suicide at his home in Tiburon, California. He was 63. The public story quickly became simple. People said depression. People remembered his past battles. But Susan kept trying to explain that the truth was not that simple. Later, the autopsy revealed diffuse Lewy body disease. The hidden disease had spread through his brain and brain stem.
That discovery changed the whole file. Lewy body dementia can affect thinking, movement, sleep, mood, behavior, and perception. It can look like Parkinson’s. It can look like psychiatric illness. It can make a person seem anxious, paranoid, forgetful, or unlike himself. In Robin’s case, it had been quietly attacking the center of who he was.
Susan later said, “Depression is a symptom of LBD and it’s not about psychology, it’s rooted in neurology. His brain was falling apart.” Those words did not erase the grief, but they gave the mystery its missing name. Robin had not simply lost a private emotional battle. He had been fighting a brain disease that was almost impossible to fully identify while he was alive.
Later, Susan described him with heartbreaking clarity. “Robin is and will always be a larger-than-life spirit who was inside the body of a normal man with a human brain.” That human brain was under attack before anyone could see the whole map.
The mystery was what no one could name in time.
Show more