89 points · by klaussilveira · 3y ago · 76 comments
1) Extremely fast GPU-accelerated terminals have a latency of slightly more than one frame due to only rendering once per frame (for performance and latency reasons).
2) Gnome-terminal sucks.
3) Old school terminals, like xterm, are extremely slow in practice, but look very fast on benchmarks like this, as they render on TTY input and do not wait (thus wasting time and latency rendering unseen changes).
4) This article is old, and misses out a lot of optimization work that has occurred on Alacritty.
5) The author of this article has a 60hz monitor. These numbers would be unreproducable on higher refresh monitors.
If a terminal program running on current low-end PC hardware can't handle updating/drawing within 1/60th of a second, something is very wrong.
This will still feel laggy, just a different kind of lag to the one that you perceive using a high latency terminal.
i think you did not understand the article
Am I missing something?
Kitty statically renders at 100hz, thus skews numbers a bit; however, this also proves all this guy measured was "time to next frame", not actual performance numbers.
https://sw.kovidgoyal.net/kitty/conf/#conf-kitty-performance
To get any better, you'd really want something like windowed VRR to consistently work on your target OS, and then any issues in Alacritty solved (if any) to take advantage of that.
Does it? I just compared it to zutty and honestly couldn't tell a difference as far as input latency is concerned.
That said, not all Vte based terminals are equal, IIRC last time I had to hunt quite far to find one that handled some of the more esoteric key modifier combinations properly, and since then I've been settled on it (Sakura)
It is interesting to see the numbers laid out like this, though.
On the other hand, if I'm drawing on a graphics tablet, and I've trained up some muscle memory skills with blind contour exercises, I don't care that much about application latency because I'm using the tactile feedback to know what the pen is doing. I only have to look to see where the cursor starts, everything else is minor adjustment.
Keyboarding is also definitely more on the muscle-memory end of the spectrum: you look to see errors, but you can generally type a whole password without seeing it, once you've practiced.
I have to agree with the OP here. I've used urxvt almost every day for years (I remember using it on a laptop with 32 MB of memory), and have never once had a problem with typing latency. I didn't even realize it was a thing people bothered to measure until I saw this article.
In older games like CS 1.6 I believe I could feel the difference between say 10 and 40 ms ping. Maybe PS/2 keyboards were faster. I got the feeling older computers were way faster to respond ... but I might remember wrong.
I don't know the specific devices you've been using over time, but in general the measurements in the following article back up your memory: https://danluu.com/input-lag/
In practice, if you actually measure time from keypress to event, you'll find that modern "gaming" keyboards are actually laggy[0].
I prefer to cap FPS in games for the same reason, if my PC can't deliver consistent frame rate.
This jitter is minimized, although not eliminated, with technologies such as Freesync, now part of HDMI and DisplayPort specs.
This is worth consideration when selecting a screen today.
> [...]
> The screen resolution was 1920x1080 and the LCD refresh rate 60 Hz
How exactly can xterm have an average end-to-end latency of 2ms, if on average you need to wait 8ms for the next frame?
The thing is that suckless people simply want to render less, and they have always kept a way to delay rendering in st. Also, the current latency is good enough that no one really complains. TBH, it's about 1~2 frame latency on 60 fps displays, and you hardly notice the difference.
What's throughput in this case?
I think Terminal.app on macOS is likely the inverse of this… it likely has a fair amount of input lag, but holy moly can it handle a lot of output being dumped at once without breaking a sweat.
The more advanced version is putting together a microcontroller which acts as a usb keyboard pressing a key, then backspace, then the key again, and uses a light sensor aimed at the right part of the screen to detect rendering in a repeatable way (slightly different fonts/ positions might change when it triggers but that’s likely on the order of a few ms tops, much less than the variance from frame boundaries).
> Some people have asked why kitty does not perform better than terminal XXX in the test of sinking large amounts of data, such as catting a large text file. The answer is because this is not a goal for kitty. kitty deliberately throttles input parsing and output rendering to minimize resource usage while still being able to sink output faster than any real world program can produce it. Reducing CPU usage, and hence battery drain while achieving instant response times and smooth scrolling to a human eye is a far more important goal.