Terminal Latency
beuke.org
beuke.org
> Applying this custom tuning results in an average latency of 5.2 ms, which is 0.1 ms lower than xterm, and that’s with having a much more sane terminal without legacy cruft.
This "legacy cruft" is as-close-as-it-gets compatibility to EVERYTHING the Terminal-based world has ever seen. It's an asset, not a liability, for those who need it, in case they need it - and that could very well be you one day.I find it quite amazing that xterm manages to more or less outperform all the other implementations while (probably - I have not actually verified) being he most complete and correct one. Thomas Dickey is the man!
Looking into it more I realized that I had unthinkingly pasted an echo '...' >> ~/.zshrc command into my .zshrc instead of running it on the command line. So every time I ran my terminal, it was not only running the same line hundreds of times, it was appending one more line.
I now appreciate a fast terminal startup much more after the experience.
I’m really interested in Mitchell Hashimoto (founder of Hashi Corp), terminal app he’s developing called Ghostty.
His latest blog post on it, also related to latency & benchmarks comparable to Alacritty.
https://mitchellh.com/writing/ghostty-devlog-006
For those interested in the tech, he’s developing it with Zig, uses SIMD extensively, and it’s cross platform. Can’t wait for him to launch it.
(I have also been bitten by terminals calling themselves `xterm-256color` or some such thing while not being remotely xterm-compatible; GNOME being the worst offender, as usual. My daily driver is mlterm¹, which is pretty good in that respect² — its main downside for me is its idiosyncratic font configuration, which is tailored for multilingual flexibility, not the English-only programmer.)
¹ https://github.com/arakiken/mlterm
² https://invisible-island.net/xterm/xterm.faq.html#bug_mlterm...
Another example is sixel support, there's a fork where it all works but is not sufficiently "proven" (code quality just as well as sixel being the best fit for the problem)
https://github.com/alacritty/alacritty/pull/4763#issuecommen...
It may be annoying but I get the reasoning, and there are other terminals.
Call me skeptical.
I can edit fine over a remote desktop connection to a machine across town where a VirtualBox is running Ubuntu, where I have Vim in a Gnome Terminal.
> The lower you can get it, the better.
Really? There is no point of diminishing returns? If you have 5 microseconds latecy in your terminal, 2 is better?
That's literally what you're saying.
I wish I could link you to byuu's deep dive on emulator latency so you could see where I'm coming from, but their site is now offline and has been excluded from the Wayback Machine. This is the old link, in case anyone knows of a mirror: byuu.org/articles/latency/
Edit: found a mirror: https://github.com/higan-emu/emulation-articles/tree/master/...
Are you really equating people's perception of tens of milliseconds of latency with their perception of nanoseconds? Is it surprising that people would notice a 50 ms slowdown more than a 50 nanosecond slowdown?
This however yields content: https://archive.is/IoShg
Wouldn't you have to first upgrade to faster cells in your retinas?
A glance through some research in this area doesn't indicate a benefit to going beyond 250 Hz.
Not if you are playing a game, or watching one of those text-art movies. But for normal terminal usage, as long as it's constant, it's just fine.
Movies don't respond to anything you're doing. A movie could be delayed by 2 seconds, and you wouldn't know, if the audio is synced, and you're not jumping around in it where you'd notice the buffering delays.
No, it isn't.
Note that if someone is talking to you from just five meters away, their audio is delayed by around that much.
It starts to be obvious at around 100.
I don't fiddle with downloaded videos due to abundant access to streaming (plus no time), but back in the day, I usually adjusted bad sync in increments of 100 ms. Maybe the odd time I would go to 50.
But you put a millisecond figure on it, which would have involved some objective measurement method and instrumentation. That figure has got to be wrong, due to some mistake.
Or else you have superhuman perception in this area. If you're talking to someone from across the room, and perceive an obvious lag in lip sync, I withdraw all my remarks.
It does help to have fast response. Agreed. I use Debian's aptitude, and man, even on a beastly desktop there is a lot of waiting >1s+. On my ultra-portables it's even worse (really should go back to atomic system images via btrfs to avoid this). Latency sucks. But I feel like there's significantly outsided attention paid to whether a terminal is 10ms or 40ms. Once we start getting to 100ms, it's starting to be a real issue, is problematic. But I think generally most devs pretty quickly reach a point where as they type and do work, they use feel & their mental model way more than the screen to achieve their goals. The feedback, when it's fast, stops being visual.
As a vim user I can be going full steam ahead without looking at feedback. People used to come by and ask, how do you read that screen, everything is so small, and in jest I'd say I don't need to, I already have perceived everything there. My internal model of where I am and where I want to go and what I want to change is only semi-gated on seeing things. I'm not particularly great at navigating between things, but it still feels like a lot of this moving-between-things and changing-things-around stuff is pushed down to a semi-subconscious layer. The brain thinks and somehow the fingers do, and it doesn't feel like I'm really paying attention as these things happen.
One of my favorite pieces of anticipation and matching, that I haven't done in a decade, is Mass Effect 2, which had a pretty neat "hacking" mini-game that involved trying to recognize which of multiple windows of scrolling code was the "right" of code, from shape. Something about that really spoke to me as one of the finer arts of coding, of pattern recognition, of being able to discern place & identify patterns & location quickly from lo-fi moving screens. Being able to navigate code & yourself by look and feel is awesome. https://masseffect.fandom.com/wiki/Bypass#Hacking
Terminals ought to be fast though. We should expect it. I respect that. Some of these terminals do seem unreasonably slow, and that should be improved. And maybe ghostty just rocks everyone & we all find we're way better after it, after terminals get way faster, but I also expect there's rapidly diminishing rapidly returns somewhere. But it'd be cool to set up on a 540 Hz monitor with a fast as sin emulator and find out if that's true or not.
Some people appear to be sensitive to throughput, some to jitter, some to absolute latency. I'd even argue that "fast" typists may be less sensitive to absolute latency as there's more of a streaming approach than with "slow" typists which is more event-based.
But it's also personal. Whatever my typing speed is, I want things to happen ~"right now".