A look at terminal emulators, part 2
A comparison of the feature sets for a handful of terminal emulators was the subject of a recent article; here I follow that up by examining the performance of those terminals. This might seem like a lesser concern, but as it turns out, terminals exhibit surprisingly high latency for such fundamental programs. I also examine what is traditionally considered "speed" (but is really scroll bandwidth) and memory usage, with the understanding that the impact of memory use is less than it was when I looked at this a decade ago (in French).
Latency
After thorough research on terminal emulators performance, I have come to the conclusion that its most important aspect is latency. In his Typing with pleasure article, Pavel Fatin reviewed the latency of various text editors and hinted that terminal emulators might be slower than the fastest text editors. That is what eventually led me to run my own tests on terminal emulators and write this series.
But what is latency and why does it matter? In his article, Fatin
defined latency as "a delay between the keystroke and corresponding
screen update
" and quoted the Handbook of Human-Computer
Interaction which says: "Delay of visual feedback on a computer
display have important
effects on typist behavior and satisfaction.
"
Fatin explained that latency has more profound
effects than just satisfaction: "typing becomes slower, more errors
occur, eye strain increases, and muscle strain increases
". In other
words, latency can lead to typos but also to lesser code quality as it
imposes extra cognitive load on the brain. But worse, "eye and muscle
strain increase" seems to imply that latency can also lead to
physical repetitive strain injuries.
Some of those effects have been known for a long time, with some
results published
in the Ergonomics journal in 1976 showing that
a hundred-millisecond delay "significantly impairs the keying
speed
". More recently, the GNOME Human Interface Guidelines set the
acceptable response time at ten milliseconds and, pushing this
limit down even further, this video from Microsoft Research shows
that the ideal target might even be as low as one millisecond.
Fatin performed his tests on editors, but he created a portable tool called Typometer that I used to test latency in terminal emulators. Keep in mind that the test is a simulation: in reality, we also need to take into account input (keyboard, USB controller, etc.) and output (graphics card and monitor buffers) latency. Those typically add up to more than 20ms in typical configurations, according to Fatin. With more specialized "gaming" hardware, the bare minimum is around three milliseconds. There is therefore little room for applications to add any latency to the pipeline. Fatin's goal is to bring that extra latency down to one millisecond or even zero-latency typing, which was released as part of IntelliJ IDEA 15. Here are my measurements, which include some text editors, showing that my results are consistent with Fatin's:
Latency in milliseconds Program mean std min 90% max uxterm 1.7 0.3 0.7 2 2.4 mlterm 1.8 0.3 0.7 2.2 2.5 Vim (Athena) 2.8 1.1 0.4 3.5 12.7 Vim (GTK2) 3.9 1.2 0.7 4.8 11.9 Emacs 4.8 2.3 0.5 5.8 32.5 gedit 8.9 3.4 2.8 12.5 14.2 Konsole 13.4 1.2 11.5 15 16.1 Alacritty 15.1 1.2 12.8 15.9 26.3 st 15.7 3.9 10.6 19.4 19.6 Vim (GTK3) 16.5 7.9 0.4 21.9 27.2 urxvt 18.3 0.3 17.3 18.7 19 pterm 23.4 0.9 21.7 24.5 25.4 GNOME Terminal 27.1 1 25.9 27.5 39.3 Xfce Terminal 27.4 0.4 26.4 27.9 28.7 Terminator 28.1 0.7 26.4 29 29.4
The first thing that struck me is that old programs like xterm and mlterm have the best response time, having worse case latency (2.4ms) better than the best case for all other terminals (10.6ms for st). No modern terminal crosses the ten milliseconds threshold. In particular, Alacritty doesn't seem to live up to his "fastest terminal emulator in existence" claims either, although results have improved since I first tested the program in July 2017. Indeed, the project seems to be aware of the situation and is working on improving the display pipeline with threads. We can also note that Vim using GTK3 is slower than its GTK2 counterpart by an order of magnitude. It might therefore be possible that the GTK3 framework introduces extra latency, as we can also observe other that GTK3-based terminals (Terminator, Xfce4 Terminal, and GNOME Terminal, for example) have higher latency.
You might not notice those differences. As Fatin explains: "one does
not necessarily need to perceive latency consciously to be affected by
it
". Fatin also warns about standard deviation (the std
column above
and the width of error bars in the graph): "any irregularities in
delay durations (so called jitter) pose additional problem because of
their inherent unpredictability
".
The graph above is from a clean Debian 9 (stretch) profile with the i3 window manager. That environment gives the best results in the latency test: as it turns out, GNOME introduces about 20ms of latency to all measurements. A possible explanation could be that there are programs running that synchronously handle input events: Fatin gives the example of Workrave, which adds latency by processing all input events synchronously. By default, GNOME also includes compositing window manager (Mutter), an extra buffering layer that adds at least eight milliseconds in Fatin's tests.
In the graph above, we can see the same tests performed on Fedora 27 with GNOME running on X.org. The change is drastic; latency at least doubled and in some cases is ten times larger. Forget the one millisecond target: all terminals go far beyond the ten milliseconds budget. The VTE family gets closer to fifty milliseconds with Terminology and GNOME Terminal having spikes well above that threshold. We can also see there's more jitter in those tests. Even with the added latency, we can see that mlterm and, to a lesser extent xterm still perform better than their closest competitors, Konsole and st.
Scrolling speed
The next test is the traditional "speed" or "bandwidth" test that
measures how fast the terminal can scroll by displaying a large
amount of text on the terminal at once. The mechanics of the test
vary; the original test I found was simply to generate the same test
string repeatedly using the seq
command. Other tests include one
from Thomas E. Dickey, the
xterm maintainer, which dumps the terminfo.src
file
repeatedly. In another review of terminal performance, Dan
Luu uses a base32-encoded string of random bytes that is
simply dumped on the terminal with cat
. Luu considers that kind of
test to be "as useless a benchmark as I can think of
" and suggests
using the terminal's responsiveness during the test as a metric
instead. Dickey also dismisses that test as misleading.
Yet both authors recognize that bandwidth can be a problem: Luu
discovered the Emacs Eshell hangs while showing large files and Dickey
implemented an optimization to work around the perceived slowness of
xterm. There is therefore still some value in this test as the
rendering process varies a lot between terminals; it also serves as a
good test harness for testing other parameters.
Here we can see rxvt and st are ahead of all others, closely followed by the much newer Alacritty, expressly designed for speed. Xfce (representing the VTE family) and Konsole are next, running at almost twice the time while xterm comes last, almost five times as slow as rxvt. During the test, xterm also had jitter in the display: it was difficult to see the actual text going by, even if it was always the same string. Konsole was fast, but it was cheating: the display would hang from time to time, showing a blank or partially drawn display. Other terminals generally display all lines faithfully, including st, Alacritty, and rxvt.
Dickey explains that performance variations are due to the design of
scrollback buffers in the different terminals. Specifically, he blames
the disparity on rxvt and other terminals "not following the same
rules
":
To fix this perceived slowness of xterm, Dickey introduced the
fastScroll
resource to allow xterm to drop some screen updates to
catch up with the flow and, indeed, my tests confirm the resource
improves performance to match rxvt. It is, however, a rather crude
implementation as Dickey explains: "sometimes xterm — like konsole —
appears to stop, since it is waiting for a new set of screen updates
after having discarded some
". In this case, it seems that other
terminals found a better compromise between speed and display
integrity.
Resource usage
Regardless of the worthiness of bandwidth as a performance metric, it
does provide a way to simulate load on the terminals, which in turn
allows us to measure other parameters like memory or disk usage. The
metrics here were obtained by running the above seq
benchmark under
the supervision of a Python process that collected the results of
getrusage() counters for ru_maxrss
, the sum of ru_oublock
and ru_inblock
, and a simple timer for wall clock time.
St comes first in this benchmark with the smallest memory footprint, 8MB on average, which was no surprise considering the project's focus on simplicity. Slightly larger are mlterm, xterm, and rxvt at around 12MB. Another notable result is Alacritty, which takes a surprising amount of memory at 30MB. Next comes the VTE family members which vary between 40 and 60MB, a higher result that could be explained by those programs use of higher-level libraries like GTK. Konsole comes last with a whopping 65MB of memory usage during the tests, although that might be excused due to its large feature set.
Compared with the results I had a decade ago, all programs take up much more memory. Xterm used to take 4MB of memory, but now takes 15MB just on startup. A similar increase also affects rxvt, which now takes 16MB of memory out of the box. The Xfce Terminal now takes 34MB, a three-fold increase, yet GNOME Terminal only takes 20MB on startup. Of course, the previous tests were done on a 32-bit architecture. At LCA 2012, Rusty Russell also explained there are many more subtle reasons that could explain such an increase. Besides, maybe this is something we can live with in this modern day and age of multi-gigabyte core memory sizes.
Yet I can't help but feel there's a waste of resources for something so fundamental as a terminal. Those programs should be the smallest of the small and should be able to run in a shoe box, when those eventually run Linux (you know they will). Yet with those numbers, memory usage would be a concern only when running multiple terminals in anything but the most limited of environments. To compensate, GNOME Terminal, Konsole, urxvt, Terminator, and Xfce Terminal feature a daemon mode that manages multiple terminals through a single process which limits the impact of their larger memory footprint.
Another result I have found surprising in my tests is actual disk I/O:
I did not expect any, yet some terminals write voluminous amounts of
data to disk. It turns out the VTE library actually writes the
scrollback buffer to disk, a "feature" that was noticed back in
2010 and that is still present in modern implementations. At least
the file contents are now encrypted with AES256 GCM
since 0.39.2,
but this raises the question of what's so special about the VTE library
that it requires such an exotic approach.
Conclusion
In the previous article, we found that VTE-based terminals have a good feature set, yet here we see that this comes with some performance costs. Memory isn't a big issue since all VTE terminals are spawned from a single daemon process that limits memory usage. Old systems tight on core memory might still need older terminals with lower memory usage, however. While VTE terminals behave well in bandwidth tests, their latency is higher than the criterion set in the GNOME Human Interface Guidelines, which is probably something that the developers of the VTE library should look into. Considering how inevitable the terminal is even for novice users in Linux, those improvements might make the experience slightly less traumatic. For seasoned geeks, changing from the default terminal might even mean quality improvements and less injuries during long work sessions. Unfortunately, only the old xterm and mlterm get us to the magic 10ms range, which might involve unacceptable compromises for some.
The latency benchmarks also show there are serious tradeoffs that came with the introduction of compositors in Linux graphical environments. Some users might want to take a look at conventional window managers, since they provide significant latency improvements. Unfortunately, it was not possible to run latency tests in Wayland: the Typometer program does exactly the kind of things Wayland was designed to prevent, namely inject keystrokes and spy on other windows. Hopefully, Wayland compositors are better than X.org at performance and someone will come up with a way of benchmarking latency in those environments in the future.
Index entries for this article | |
---|---|
GuestArticles | Beaupré, Antoine |
Posted Apr 15, 2018 14:07 UTC (Sun)
by nim-nim (subscriber, #34454)
[Link] (7 responses)
Posted Apr 15, 2018 23:01 UTC (Sun)
by zlynx (guest, #2285)
[Link] (6 responses)
I have many complaints about them. But they work well enough most of the time.
I do wish that they would focus on a true real-time approach to input and output. There should be no excuse for processing delays getting input to an application or in handing over a completed frame. All of their fancy animations and application displays should be secondary.
Speaking of that though, Arcan is a pretty neat approach to display servers.
Posted Apr 23, 2018 11:33 UTC (Mon)
by renox (guest, #23785)
[Link] (5 responses)
Bah, their motto "every frame is perfect" imply that resizing a window can become laggy/jerky (compared to a server side solution where you allow resizing the frame even if the content is "interpolated") if the client cannot provide the frame fast enough..
Posted Apr 25, 2018 13:07 UTC (Wed)
by dgm (subscriber, #49227)
[Link] (1 responses)
That "if" is key. It means that, with Wayland, you have the possibility of perfect frames. This is a good thing.
Posted Nov 12, 2018 3:18 UTC (Mon)
by immibis (guest, #105511)
[Link]
Posted Apr 25, 2018 16:50 UTC (Wed)
by raven667 (subscriber, #5198)
[Link] (1 responses)
I'm not seeing an issue here, if the application cannot repaint its window on resize correctly or quickly, then the contents of the window frame is garbage until it completes its repaint, the window isn't successfully resized until it is correctly repainted. If the application isn't repainting, it's laggy either way, one way fills the frame with garbage and one represents the actual state of the application, if you wanted define a compositor which shows a potential window resize but doesn't actually do the resize until you've let off the mouse, I suppose you could do that but it doesn't seem like a lot of people want it to work that way, they just expect applications to successfully repaint quickly on resize.
Posted Apr 25, 2018 19:02 UTC (Wed)
by mpr22 (subscriber, #60784)
[Link]
Posted May 11, 2018 7:22 UTC (Fri)
by daenzer (subscriber, #7050)
[Link]
Posted Apr 15, 2018 14:53 UTC (Sun)
by jnareb (subscriber, #46500)
[Link]
Second, with multiple terminal windows the memory consumption would be not, I think, the sum of memory consumption of single terminal. Much of memory is shared, isn't it?
Posted Apr 15, 2018 17:55 UTC (Sun)
by Jonimus (subscriber, #89694)
[Link]
Posted Apr 15, 2018 19:22 UTC (Sun)
by jhoblitt (subscriber, #77733)
[Link] (15 responses)
Posted Apr 15, 2018 19:42 UTC (Sun)
by felixfix (subscriber, #242)
[Link] (11 responses)
Posted Apr 15, 2018 19:56 UTC (Sun)
by jhoblitt (subscriber, #77733)
[Link] (10 responses)
Posted Apr 16, 2018 9:08 UTC (Mon)
by farnz (subscriber, #17727)
[Link] (7 responses)
Visual perception is a deep and complex field; it's a long time since I studied this, so please excuse the lack of references. Underlying this is that there is an in-brain model of what you "expect" to see; your visual input is used to update that model, and things about the model that are either unexpected or an area of focus then bubble up to conscious perception. There are three numbers of interest for terminal use cases:
These numbers are all separately measurable with the right equipment, and when I studied this (around 2002), the first was single digit milliseconds in skilled object recognisers (the paper I recall, but cannot find, said that military pilots could accurately identify aircraft that appeared in their field of view for under 4ms; going lower was not possible with the equipment available to the experimenters). The second is around 100ms, but note that you have to allow for input latency, processing latency and output latency in this number, so with 4ms lag on keypresses, and 1ms processing time, you're down to 95ms for display time. The final one is also around 100ms, but is an inter-frame delay; as long as you can output a frame every 100ms or less, you can trick the visual system into seeing smooth movement.
Note, too, that there is a resolution/frame rate tradeoff available with the last one - if you have very high resolution, and use that resolution to accurately simulate the "expected" motion effects (blur etc), then you can get away with the full 100ms. If you have lower resolution, you need a lower frame time to compensate.
So, even a 16ms delay could be noticeable, if what's going on is object recognition rather than animation.
Posted Apr 17, 2018 17:39 UTC (Tue)
by tartley (subscriber, #96301)
[Link] (5 responses)
This is even with games doing lots of clever stuff to minimize the effect of lag like predicting where objects will be before receiving the confirmatory network message, so the delta's are much smaller.
I don't know if the figures I'm quoting are one way client to server lag, or round trip.
Posted Apr 17, 2018 17:55 UTC (Tue)
by farnz (subscriber, #17727)
[Link] (3 responses)
The lag you're referring to is normally round trip time between the two network endpoints. However, this comes into the 100ms "input to response" lag - the game has 100ms minus the lag you're referring to to detect your input, decide what it's doing, run physics to catch up, output a frame to the screen and have the screen output that as light to you. Input detection is typically 2ms, frame output has typically 33ms delay on a good engine, monitor adds its own delay etc.
Thus, of the 100ms input to response lag budget, you're eating 35ms in pure hardware delays (triple buffering, input latency), plus whatever lag your monitor has, plus the game's working time between input and rendering a new frame, plus the network lag. At 60ms network lag, you're saying that the game and your monitor have just 5ms from input to displaying light - even at 20ms network lag, you're only giving the game and monitor 45ms to react to your actions and display light in response.
Plus, for network games, you get added fun with the need to maintain globally synchronised state - if your opponents are getting light in response to their actions before you, they have an advantage; if this advantage is more than a small number of ms (4ms object recognition delay upper bound, remember), then they are able to recognise your player and start reacting before you have even acted on their presence.
Basically, this is very, very complex, and an utter pain to get right on a human scale.
Posted Apr 17, 2018 19:37 UTC (Tue)
by Cyberax (✭ supporter ✭, #52523)
[Link] (2 responses)
Posted May 21, 2018 2:46 UTC (Mon)
by JanC_ (guest, #34940)
[Link] (1 responses)
Posted May 21, 2018 11:32 UTC (Mon)
by excors (subscriber, #95769)
[Link]
Posted Apr 19, 2018 8:39 UTC (Thu)
by jond (subscriber, #37669)
[Link]
Posted Apr 19, 2018 10:46 UTC (Thu)
by michaelkjohnson (subscriber, #41438)
[Link]
Wikipedia lists a fairly old citation: James Davis (1986), "Humans perceive flicker artefacts at 500 Hz", Sci Rep, Wiley, 5: 7861, doi:10.1038/srep07861, PMC 4314649 Freely accessible, PMID 25644611 — https://www.nature.com/articles/srep07861 "A separate line of research has reported that fast eye movements known as saccades allow simple modulated LEDs to be observed at very high rates. Here we show that humans perceive visual flicker artifacts at rates over 500 Hz when a display includes high frequency spatial edges. This rate is many times higher than previously reported." (This is why I typically drive LED PWM at 2+ kHz.)
Posted Apr 17, 2018 8:11 UTC (Tue)
by flussence (guest, #85566)
[Link]
Posted Apr 26, 2018 12:12 UTC (Thu)
by nim-nim (subscriber, #34454)
[Link]
Posted Apr 15, 2018 20:56 UTC (Sun)
by WolfWings (subscriber, #56790)
[Link] (2 responses)
There's been 120Hz (and even 240Hz capable if you switch the screen resolution to 720p in some cases) screens available for under $300 all the way back in 2013. I'd call that pretty mass-market by most standards. Even cheap-as-dirt LCDs often support 85Hz, 90Hz, or higher, they just advertise Native@60p (or 59.NTSCwhatever) as their 'native/default' mode for compatibility reasons.
And the article does mention that in most cases without special configuration and/or hardware the output latency of the display pipeline is larger than what's being measured. Heck I've seen plenty of monitors that inflict 4-5 FRAMES of delay/latency, so an old Seiki 4K@30 monitor? 150ms output latency, or still 40ms if you flip it to 1080p120 mode.
Posted Apr 16, 2018 0:13 UTC (Mon)
by jhoblitt (subscriber, #77733)
[Link] (1 responses)
Posted Apr 17, 2018 11:27 UTC (Tue)
by knan (subscriber, #3940)
[Link]
Posted Apr 15, 2018 20:18 UTC (Sun)
by xtifr (guest, #143)
[Link] (3 responses)
I ran typometer on my system on xterm (x), Emacs M-x ansi-term (e), and Gnome terminal (g), and here's the results I got:
x: avg: 41.9, min: 18.2, max: 81.9, SD: 14.9
This was not a careful test; I didn't worry about shutting down other processes or doing any of that other stuff you might want to do to get the most accurate results. I'm not even entirely sure what I was testing (though it was interesting to watch it run.) Nevertheless, it does seem to suggest that M-x ansi-term performs surprisingly well.
I'm not saying that you'd want to start using Emacs just as a tool to run vim and mutt, but it looks like it's not as unreasonable a suggestion as it might sound! :D
Posted Apr 15, 2018 20:34 UTC (Sun)
by xtifr (guest, #143)
[Link] (2 responses)
So I think maybe I won't make it my *primary* terminal emulator just yet... :)
Posted Apr 16, 2018 16:24 UTC (Mon)
by iabervon (subscriber, #722)
[Link] (1 responses)
Posted Apr 16, 2018 21:02 UTC (Mon)
by xtifr (guest, #143)
[Link]
Posted Apr 16, 2018 0:13 UTC (Mon)
by nix (subscriber, #2304)
[Link] (3 responses)
Personally I'm a convert to the effectively infinite scrollback this approach permits: I find it extremely pleasant to know that absolutely everything I did since my last X startup is going to be sitting in scrollback somewhere, without DoS-attacking my system in the process -- I just wish terminator had a way to search *all* consoles' scrollbacks rather than only the current one :P
Posted Apr 17, 2018 8:43 UTC (Tue)
by flussence (guest, #85566)
[Link] (2 responses)
Then I got to the end and saw the massive gaps between comment numbers. Ouch. Bit ironic that nobody gets to learn from history on a bug about infinite scrollback.
Posted Apr 20, 2018 9:48 UTC (Fri)
by ovitters (guest, #27950)
[Link] (1 responses)
There's no point in making these comments publicly visible. They're hidden for pretty much everyone, except for maybe 5 people. All of the gnome-terminal or vte (past or existing) developers can _NOT_ see those comments. The reason for this is pretty simple, the person is trying to get people annoyed. Every time a developer would read the bug the person would again get annoyed. Instead we (admins and often non-developers) hide it all. This allows developers to focus on developing.
Posted Apr 21, 2018 22:57 UTC (Sat)
by nix (subscriber, #2304)
[Link]
Posted Apr 16, 2018 5:02 UTC (Mon)
by ewen (subscriber, #4772)
[Link]
Low latency *and* lack of output tearing is a non-trivial problem (since, eg, the obvious way to avoid output tearing is to start new output at the top of frame sync, implying up to one frames sync of delay). I suspect older terminal programs probably just went for raw output and ignored frame sync -- but the modern trend is to minimise output tearing, through double/triple buffering, compositors, etc. Still it's useful to have actual numbers for what we're paying for this "clean" output. Thanks for the article!
Ewen
Posted Apr 16, 2018 12:35 UTC (Mon)
by HenrikH (subscriber, #31152)
[Link] (5 responses)
The big command is aprox 33kb (I have not measured the limit on where the error triggers). Enter it an return, all works fine. But now if we try with cursor up in order to edit the command again then the terminal is seriously borked, e.g displayed on screen is just the last portion of the command that would fit, hitting HOME put's you on the first line but the output is not changed so you have to edit blind. Another strange thing is that if you use cursor left in order to traverse over the command then the cursor just moves left to right on the last line and when hitting the leftmost position it goes directly to the rightmost on the last line instead of going up one line.
Meanwhile the scrollback works without any problems here.
Posted Apr 16, 2018 13:09 UTC (Mon)
by murukesh (subscriber, #97031)
[Link] (4 responses)
Posted Apr 17, 2018 8:56 UTC (Tue)
by flussence (guest, #85566)
[Link] (2 responses)
Posted Apr 19, 2018 9:12 UTC (Thu)
by HenrikH (subscriber, #31152)
[Link]
Posted Apr 19, 2018 19:40 UTC (Thu)
by JFlorian (guest, #49650)
[Link]
Posted Apr 19, 2018 9:11 UTC (Thu)
by HenrikH (subscriber, #31152)
[Link]
Posted Apr 16, 2018 22:09 UTC (Mon)
by anarcat (subscriber, #66354)
[Link] (2 responses)
https://gitlab.com/anarcat/terms-benchmarks
... with a (potentially out of date) mirror on GitHub here:
Posted Apr 16, 2018 22:11 UTC (Mon)
by anarcat (subscriber, #66354)
[Link]
https://github.com/anarcat/terms-benchmarks/blob/master/b...
an older version with the first round of tests:
https://github.com/anarcat/terms-benchmarks/blob/master/b...
Posted Apr 19, 2018 19:45 UTC (Thu)
by JFlorian (guest, #49650)
[Link]
Posted Apr 17, 2018 15:37 UTC (Tue)
by mirabilos (subscriber, #84359)
[Link] (27 responses)
Posted Apr 17, 2018 15:47 UTC (Tue)
by anarcat (subscriber, #66354)
[Link] (26 responses)
For what it's worth, after all of this work reviewing all terminal emulators, I still haven't found a reason to switch away from rxvt. I'm still a little disappointed by the incomplete unicode support, but I have yet to find a single terminal that would display emoji's correctly (e.g. this is fire! 🔥), which would be the primary reason for switching away.
Posted Apr 17, 2018 15:51 UTC (Tue)
by sfeam (subscriber, #2841)
[Link]
Posted Apr 17, 2018 16:27 UTC (Tue)
by zdzichu (subscriber, #17118)
[Link] (2 responses)
Gives https://pipebreaker.pl/z/tilix.fire.png
(false colors because of GNOME bug being fixed – color channels are swapped; the fire is orange/red in elinks).
Posted Apr 17, 2018 16:35 UTC (Tue)
by anarcat (subscriber, #66354)
[Link] (1 responses)
Posted Apr 28, 2018 15:25 UTC (Sat)
by flussence (guest, #85566)
[Link]
Posted Apr 17, 2018 16:30 UTC (Tue)
by mirabilos (subscriber, #84359)
[Link] (20 responses)
Most Truetype fonts don’t cover Unicode well either (as opposed to 9x18/18x18 fixedmisc, which has over 40k glyphs in the variant I maintain), so you’d need to have a program do fallback glyph substitution whenever the chosen font doesn’t carry it; terminal emulators normally don’t, and most Truetype fonts are not suitable in a monospaced environment either. Since my dpi is small enough, I chose to just stick with a bitmap font with extremely decent BMP coverage, occasionally adding the odd new glyph (or one needed because wcwidth() for a char changed) myself.
Posted Apr 26, 2018 10:41 UTC (Thu)
by grawity (subscriber, #80596)
[Link]
so you’d need to have a program do fallback glyph substitution whenever the chosen font doesn’t carry it; terminal emulators normally don’t These days most of them do. (Even urxvt does if you list multiple fonts.)
Posted Apr 28, 2018 21:44 UTC (Sat)
by cm7 (guest, #124032)
[Link] (18 responses)
Are 9x18/18x18 supposed to part of the default aliases when one installs misc-fixed? I can't find them.
Posted Apr 28, 2018 22:24 UTC (Sat)
by mirabilos (subscriber, #84359)
[Link] (17 responses)
I occasionally publish snapshots at http://www.mirbsd.org/MirOS/dist/mir/Foundry/ but that’s been a while.
It lives in CVS at http://www.mirbsd.org/cvs.cgi/contrib/fonts/fixed/ (ignore the 9x18/ subdirectory there for now, I never got around to finishing that idea), but needs bdfctool from http://www.mirbsd.org/cvs.cgi/X11/extras/bdfctool/ to compile from .bdfc to .bdf (and then the usual bdftopcf from XFree86®/X.org to convert to .pcf for installation; you can also install the .bdf, but it takes much longer to load).
For Debian users, http://www.mirbsd.org/~tg/Debs/dists/sid/wtf/Pkgs/xfonts-... is the easier way, it contains a replacement xfonts-base package with all the standard fonts (although not in the version in Debian, but in the latest one from XFree86® (which has fixes over X.org) plus fixes _from_ X.org plus fixes of my own), plus FixedMisc.
The 9x18/18x18 are not standard aliases, I just use them to describe the font sizes. The X long font descriptions for the font I mean (for -fn and -fw for xterm, for example) are:
-MirOS-FixedMisc-Medium-R-Normal--18-120-100-100-C-90-ISO10646-1
and
-MirOS-FixedMisc-Medium-R-Normal--18-120-100-100-C-180-ISO10646-1
there’s also an 8x16 VGA variant for e.g. PXELINUX:
-MirOS-FixedMiscPC-Medium-R-Normal--16-120-100-100-C-80-IBM-cp437
If you install xfonts-base from above, the aliases mirhw, mirfw, mirvga (in this order; hw=halfwidth, fw=fullwidth) will be predefined. (Also in MirBSD… in case anyone uses it.)
The stock equivalents of these from Fixed [Misc] are:
-misc-fixed-medium-r-normal--18-120-100-100-c-90-iso10646-1
-misc-fixed-medium-r-normal-ko-18-120-100-100-c-180-iso10646-1
FixedMisc [MirOS] used the -ko- variant of 18x18 as base, but took some glyphs from the -ja- variant instead. It *can* be installed to overwrite Fixed [Misc] 9x18/18x18ko as well (the fixedmir.ed script patches the files to use the Fixed [Misc] font names, and possibly other (compatibility) changes), but does not need to be (FixedMisc uses mirf16v8.bdf, mirf18fw.bdf, mirf18hw.bdf as names whereas Fixed uses 9x18.bdf, 18x18ko.bdf, and does not have a matching 8x16 VGA font).
Hope this helps; otherwise, just reply (within 30 days) or contact me e.g. on IRC if you have any questions back.
Bonus: the xfonts-base package also adds it as /usr/share/grub/FixedMisc.pf2 for GNU GRUB 2 (both halfwidth and fullwidth, all 40k+ glyphs) and /usr/share/consolefonts/mirf16v8.psf (without) and /usr/share/consolefonts/mirf16v8.psfu (with Unicode map) for the Linux VGA text console; I also have an adapted console-setup package which contains the font as 9x18, subsetted for the framebuffer or VGA console with a custom encoding (it replaces the Arabic and Hebrew by more Line Drawing characters to be able to display mc and other things properly).
Posted Apr 28, 2018 23:00 UTC (Sat)
by cm7 (guest, #124032)
[Link] (14 responses)
I'll try the files you linked, thank you!
Posted Apr 28, 2018 23:59 UTC (Sat)
by mirabilos (subscriber, #84359)
[Link] (8 responses)
For Truetype, I use Inconsolata from Teχ/LᴬTᴇX with the varl and varqu options (zero slashed, l distinct from I and 1, ' and " quotes straight down to distinguish from ‘’ and “”); since these are OTF features and most programs don’t deal with them, I put up a version at http://mirsolutions.de/music/free/resources/ that incorporates this as default.
OK, back to FixedMisc: the .deb is up-to-date, only the snapshot on the website isn’t. For bdfc to bdf conversion all you need is bdfctool from cvsweb (which I linked) and the utilities it requires (it’s a shell script, so, coreutils, mksh … actually, I think it does not even need coreutils, only shell builtins).
Posted Apr 29, 2018 0:22 UTC (Sun)
by cm7 (guest, #124032)
[Link] (1 responses)
Posted Apr 29, 2018 16:35 UTC (Sun)
by mirabilos (subscriber, #84359)
[Link]
I’ve adjusted all ‘l’ in the 9x18 and the one in the 18x18 font.
Posted Apr 29, 2018 0:24 UTC (Sun)
by cm7 (guest, #124032)
[Link] (2 responses)
Posted Apr 29, 2018 0:30 UTC (Sun)
by cm7 (guest, #124032)
[Link] (1 responses)
Posted Apr 29, 2018 16:49 UTC (Sun)
by mirabilos (subscriber, #84359)
[Link]
This will create two files, mirf18hw.bdf and mirf18fw.bdf, which then have the MirOS foundry and can be installed alongside without influencing system fonts.
The XFree86®/X.org standard tool bdftopcf can be used to compile them into .pcf, then just gzip -n9 them and install them into a directory, then run mkfontdir and mkfontscale on that directory.
Posted Apr 29, 2018 0:42 UTC (Sun)
by cm7 (guest, #124032)
[Link] (2 responses)
Posted Apr 29, 2018 16:45 UTC (Sun)
by mirabilos (subscriber, #84359)
[Link] (1 responses)
I’ve also fixed up a few fontconfig warnings.
Your comment made me look at that font a bit more, and I am a bit surprised about the curly braces indeed. (Additionally, thanks to subpixel hinting, even at 36pt the round parenthesēs don’t exactly align, but meh.) I normally know that the tips of curly and angle braces like }< align.
On the other hand, looking at [A] and {A}, I think it matches. In FixedMisc, we have a bit of space, and the bottom of the A aligns with the bottom of the braces and brackets, whereas in Inconsolata, they seem to surround the content more. Also, since the curly braces are slightly more high, we cannot simply lift them, because the upper end will then be _too_ high. Hm. I sure could try to move that up, but I don’t know if that suffices for you…
Just looking at my post in an “xterm -fa Inconsolatazi4varl_qu”, I find that, due to the enclosing, *both* [A] (brackets could be both a bit higher and lower) and {A} (braces’ lower end is ok, upper end could be a bit higher) don’t look well, but I find it bearable. It’s a more typograph-ish font, what with having smaller digits as well, and all that.
Posted May 7, 2021 22:46 UTC (Fri)
by mirabilos (subscriber, #84359)
[Link]
Posted Apr 29, 2018 0:00 UTC (Sun)
by cm7 (guest, #124032)
[Link] (3 responses)
Posted Apr 29, 2018 0:21 UTC (Sun)
by mirabilos (subscriber, #84359)
[Link] (2 responses)
You’d lose massively in glyphs, though. You can increase thickness of them by manually editing them (e.g. with bdfctool), of course… but that’s a lot of work, plus: even with 18x18, the Asian glyphs and some of the Arabic “let’s troll bitmap font users” ones are stretching it. That’s why I decided to just get used to the thin style (and use a screen with lower dpi).
Posted Apr 29, 2018 0:36 UTC (Sun)
by cm7 (guest, #124032)
[Link] (1 responses)
Posted Apr 29, 2018 16:36 UTC (Sun)
by mirabilos (subscriber, #84359)
[Link]
Just use the xlfd (as shown by e.g. xfontsel, or in the FONT header of the .bdf file (hFONT in .bdfc) near its top).
Posted Apr 29, 2018 0:01 UTC (Sun)
by mirabilos (subscriber, #84359)
[Link]
On the plus side, it *does* have 50105 glyphs readily available…
Posted Apr 28, 2018 23:05 UTC (Sat)
by cm7 (guest, #124032)
[Link] (1 responses)
Posted Apr 28, 2018 23:22 UTC (Sat)
by cm7 (guest, #124032)
[Link]
Posted Apr 17, 2018 23:43 UTC (Tue)
by xtifr (guest, #143)
[Link]
Posted Apr 18, 2018 20:31 UTC (Wed)
by bobbytables (guest, #65908)
[Link] (2 responses)
I was already using openbox with XFCE but my latency with vim was still averaging 50 ms.
I've changed to xterm and I'm getting 12 ms now.
It's not just the numbers. It's a massive difference in experience, similar to playing a game at 50 fps now, compared to 20 before. Typing and scrolling is much more pleasurable.
Posted Apr 18, 2018 20:46 UTC (Wed)
by bobbytables (guest, #65908)
[Link] (1 responses)
Posted Apr 18, 2018 21:15 UTC (Wed)
by anarcat (subscriber, #66354)
[Link]
Posted Apr 19, 2018 10:57 UTC (Thu)
by mezcalero (subscriber, #45103)
[Link] (3 responses)
😬 😬 😬
Posted Apr 27, 2018 16:55 UTC (Fri)
by Tara_Li (guest, #26706)
[Link]
Posted May 4, 2018 9:41 UTC (Fri)
by mgedmin (subscriber, #34497)
[Link] (1 responses)
Posted May 5, 2018 17:29 UTC (Sat)
by flussence (guest, #85566)
[Link]
Posted Apr 26, 2018 7:46 UTC (Thu)
by Jiehong (guest, #109656)
[Link]
Checking the article you linked regarding the Gnome HIG acceptable response times (for version 3.12), it says "0.1 second", which is 100 ms, and not 10 ms.
With this data in mind, all terminals become acceptable!
Looking at the same page for "unstable" gives the very same data: https://developer.gnome.org/hig-book/unstable/feedback-re...
I'd be a lot happier if it actually was set at 10 ms, though.
Posted Apr 26, 2018 12:56 UTC (Thu)
by dcg (subscriber, #9198)
[Link] (2 responses)
Posted Apr 26, 2018 14:33 UTC (Thu)
by zlynx (guest, #2285)
[Link]
Virtual is definitely a useless measurement. No one cares if you have 100 GB of virtual, because it is just pretend and not real.
PSS (Process shared) is useful when you run a lot of applications that use the same libraries. If you have 20 terminals open then you can fairly say that each is using 1/20th of a shared library or 1/20th of a font glyph cache.
But for testing one terminal program at a time what could be better than straight RSS? That's exactly how much RAM is required to run one terminal.
Posted Apr 27, 2018 12:31 UTC (Fri)
by darwish (guest, #102479)
[Link]
>> Hmm, that's exactly what I did for PulseAudio three years ago. What else would you propose?
Posted Apr 26, 2018 21:45 UTC (Thu)
by jspricke (guest, #123988)
[Link] (3 responses)
setting xfps and actionfps to 1000
xfps == fps == 5000
setting dodraw = 1
Posted May 3, 2018 13:26 UTC (Thu)
by idhx (guest, #124131)
[Link]
What does dodraw do?
Posted Dec 16, 2019 14:50 UTC (Mon)
by life@1ms (guest, #136139)
[Link]
I wonder why your dash is the slowest when these guys seem to be saying it is the fastest:
Posted Jan 4, 2021 15:04 UTC (Mon)
by life@1ms (guest, #136139)
[Link]
Posted Apr 27, 2018 14:02 UTC (Fri)
by sgourichon (guest, #88605)
[Link]
I'm shocked, too. None of my terminal sessions are that secret, but I understand it can be a real problem for some people. It breaks expectations about the role of a terminal emulator. Wrapping the mess in encryption feels so wrong, I second https://bugzilla.gnome.org/show_bug.cgi?id=631685#c14
> is still present in modern implementations.
So, what's actual behavior?
On Ubuntu 16.04, on an account where xfce4-terminal is setup to record a finite number (1000000 lines), on a X session where no xfce4-terminal is running, this command launched in another terminal (uxterm for that matter, running 'script' to get a session transcript):
strace -etrace=file xfce4-terminal
then in the appearing xfce4-terminal, running a command that spits huge amount of text (a "find" which finds 1.3 million entries), doesn't show any sign of xfce4-terminal writing any data to disk, or opening any file to /tmp, /var/tmp or even any file for writing.
Also, /proc/$PID/fd does not show any such file or any mention of deleted file.
This seems consistent with what is written in bug report https://bugzilla.gnome.org/show_bug.cgi?id=664611 : write-to-disk feature is activated only when scrollback is set to infinite.
Conclusion : it looks like the simplest way to disable "scrollback-to-disk" feature it is to not set scrollback limit to infinite, but to a big enough value, and relying on 'script' on selected terminals where logging is useful.
Posted Apr 28, 2018 20:50 UTC (Sat)
by CycoJ (guest, #70454)
[Link]
Posted Nov 25, 2018 6:49 UTC (Sun)
by sabrehagen (guest, #128824)
[Link]
Posted Apr 2, 2024 20:04 UTC (Tue)
by Kana (guest, #170579)
[Link]
A look at terminal emulators, part 2
Anything that loads the compositor, for example another term scrolling logs, will result in input starvation, seconds of delay lost keypresses or even out of order injection when typing and mice pasting
A look at terminal emulators, part 2
A look at terminal emulators, part 2
A look at terminal emulators, part 2
A look at terminal emulators, part 2
A look at terminal emulators, part 2
Given the way some software behaves under redraw-during-resize, I'm inclined to think empty-frame resize (and empty-frame move) would be a nifty feature to have in a Wayland compositor.
A look at terminal emulators, part 2
A look at terminal emulators, part 2
Robust statistics, and memory consumption
A look at terminal emulators, part 2
A look at terminal emulators, part 2
A look at terminal emulators, part 2
A look at terminal emulators, part 2
A look at terminal emulators, part 2
A look at terminal emulators, part 2
A look at terminal emulators, part 2
A look at terminal emulators, part 2
A look at terminal emulators, part 2
That seems common on TVs, but then they often have a 'game mode' that disables the expensive image processing to get back to acceptable latency. Something explicitly advertised as a gaming monitor should always be low-latency, because latency is pretty much the defining characteristic of a gaming monitor. (Well, latency plus ridiculously ugly styling). E.g. the PG258Q (commonly used by pro gamers) apparently has a "display lag" of under 5ms (signal processing plus pixel response time, relative to a CRT on the same graphics card). (It also has a light on the bottom that can project a stupid logo onto your desk). And since it's 240Hz, a few frames of latency in the GPU won't add up to many msecs.
A look at terminal emulators, part 2
A look at terminal emulators, part 2
Critical fusion frequency
A look at terminal emulators, part 2
A look at terminal emulators, part 2
A look at terminal emulators, part 2
A look at terminal emulators, part 2
A look at terminal emulators, part 2
A look at terminal emulators, part 2
e: avg: 42.8, min: 25.5, max: 80.1, SD: 12.2
g: avg: 65.5, min: 44.6, max: 83.3, SD: 9.6
A look at terminal emulators, part 2
A look at terminal emulators, part 2
A look at terminal emulators, part 2
A look at terminal emulators, part 2
A look at terminal emulators, part 2
A look at terminal emulators, part 2
A look at terminal emulators, part 2
A look at terminal emulators, part 2
History problems
History problems
History problems
History problems
History problems
History problems
reproducible results
reproducible results
reproducible results
A look at terminal emulators, part 2
That would definitely explain the results I had on my normal setup, where I used the following A look at terminal emulators, part 2
.Xresources
:
XTerm*faceName: Monospace Regular
UXTerm*faceName: Monospace Regular
XTerm*faceSize: 11
UXTerm*faceSize: 11
*saveLines: 6000
I originally thought it was only the extra scrollback buffer I had configured, but it could also be the combination of both...
"(e.g. this is fire! 🔥)" displays correctly in konsole.
A look at terminal emulators, part 2
A look at terminal emulators, part 2
vte3-0.36.5-6.fc28.x86_64
A look at terminal emulators, part 2
A look at terminal emulators, part 2
A look at terminal emulators, part 2
A look at terminal emulators, part 2
A look at terminal emulators, part 2
A look at terminal emulators, part 2
A look at terminal emulators, part 2
A look at terminal emulators, part 2
A look at terminal emulators, part 2
A look at terminal emulators, part 2
We already handled 0 vs. O and 1 vs. I/l and Farn/Fam well, and
probably cannot do anything about the blurring/thickening stuff.
A look at terminal emulators, part 2
A look at terminal emulators, part 2
A look at terminal emulators, part 2
A look at terminal emulators, part 2
A look at terminal emulators, part 2
A look at terminal emulators, part 2
A look at terminal emulators, part 2
A look at terminal emulators, part 2
A look at terminal emulators, part 2
A look at terminal emulators, part 2
A look at terminal emulators, part 2
A look at terminal emulators, part 2
A look at terminal emulators, part 2
A look at terminal emulators, part 2
A look at terminal emulators, part 2
A look at terminal emulators, part 2
With that on, my scores improve 50%, although at 7 ms avg on xterm + vim is the minimum I could get.
I did not. As stated in the detailed procedure, I used the default configuration as those are the ones Fatin used in his tests as well.
A look at terminal emulators, part 2
A look at terminal emulators, part 2
A look at terminal emulators, part 2
A look at terminal emulators, part 2
A look at terminal emulators, part 2
Gnome Response Times are set to 0.1 second, not 10 ms
A look at terminal emulators, part 2
A look at terminal emulators, part 2
Measuring memory usage by looking at RSS
Measuring memory usage by just looking at RSS? Really?
A look at terminal emulators, part 2
Also the shell running inside it makes quite a difference
On my system using Debian sid, Xorg, dwm:
(numbers in ms: Min, Max, Avg, SD)
default xfps:
st 0.8.1, exec dash: 18.5 33.0 22.1 1.5
st 0.8.1 exec fish: 11.2 35.5 17.4 3.5
st 0.3, exec fish: 2.4 10.5 4.9 2.0
https://git.suckless.org/st/tree/config.def.h#n45
st 0.8.1, exec fish: 3.1 11.2 6.8 1.8
st 0.8.1, exec fish: 3.2 10.8 5.8 2.0
https://git.suckless.org/st/tree/x.c#n1820
st 0.8.1, exec fish: 2.2 11.7 4.8 1.9
A look at terminal emulators, part 2
A look at terminal emulators, part 2
https://github.com/fish-shell/fish-shell/issues/2776
or is mksh the fastest?
A look at terminal emulators, part 2
https://st.suckless.org/patches/sync/
Scrollback to disk?
See also [Bug 664611 – Deleted tmp files' filehandles still contain contents of buffers and are on disk](https://bugzilla.gnome.org/show_bug.cgi?id=664611#c48 "Bug 664611 – Deleted tmp files' filehandles still contain contents of buffers and are on disk")
It would be interesting to include kitty in that comparison as the project specifically states that that one optimization goal is tuning for latency. I've just installed it and it does in fact feel significantly faster than my usual terminal emulator (terminology). I didn't even think I would notice a difference, but it's there. Interestingly kitty provides a way of syncing to screen refresh.
A look at terminal emulators, part 2
A look at terminal emulators, part 2
A look at terminal emulators, part 2
For example, in my machine if I place "Rxvt*refreshRate: 200" in ~/.Xdefaults, the latency falls from 18ms to 5ms.