[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
|
|
Subscribe / Log in / New account

A look at terminal emulators, part 2

April 15, 2018

This article was contributed by Antoine Beaupré

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".

[Latency on Debian]

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.

[Latency on Fedora]

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.

[Scrolling speed]

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":

Unlike xterm, rxvt did not attempt to display all updates. If it fell behind, it would discard some of the updates, to catch up. Doing that had a greater effect on the apparent scrolling speed than its internal memory organization, since it was useful for any number of saved-lines. One drawback was that ASCII animations were somewhat erratic.

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.

[Memory use]

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.

[Disk I/O]

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
GuestArticlesBeaupré, Antoine


to post comments

A look at terminal emulators, part 2

Posted Apr 15, 2018 14:07 UTC (Sun) by nim-nim (subscriber, #34454) [Link] (7 responses)

Wayland would be much worse. It moves input handling to the compositor, and mutter for example was never designed to process low latency input in parallel to the rest of its functions.
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

Posted Apr 15, 2018 23:01 UTC (Sun) by zlynx (guest, #2285) [Link] (6 responses)

Yes, well, Wayland, gnome-shell and mutter . . .

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.

A look at terminal emulators, part 2

Posted Apr 23, 2018 11:33 UTC (Mon) by renox (guest, #23785) [Link] (5 responses)

> I do wish that they would focus on a true real-time approach to input and output.

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..

A look at terminal emulators, part 2

Posted Apr 25, 2018 13:07 UTC (Wed) by dgm (subscriber, #49227) [Link] (1 responses)

> resizing a window can become laggy/jerky (...) **if** the client cannot provide the frame fast enough..

That "if" is key. It means that, with Wayland, you have the possibility of perfect frames. This is a good thing.

A look at terminal emulators, part 2

Posted Nov 12, 2018 3:18 UTC (Mon) by immibis (guest, #105511) [Link]

You also have the *possibility* with X. "Every frame is perfect" is intended to mean that *every frame* is perfect, not that *some frames* are perfect.

A look at terminal emulators, part 2

Posted Apr 25, 2018 16:50 UTC (Wed) by raven667 (subscriber, #5198) [Link] (1 responses)

> resizing a window can become laggy/jerky

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.

A look at terminal emulators, part 2

Posted Apr 25, 2018 19:02 UTC (Wed) by mpr22 (subscriber, #60784) [Link]

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

Posted May 11, 2018 7:22 UTC (Fri) by daenzer (subscriber, #7050) [Link]

Sounds like you haven't actually tried it? IME window resizing with Wayland is smoother than it could ever be with X. (Speaking as someone who has been working on X for going on two decades)

Robust statistics, and memory consumption

Posted Apr 15, 2018 14:53 UTC (Sun) by jnareb (subscriber, #46500) [Link]

First, if you worry about outliers messing up the standard deviation (and to lesser extent also mean), perhaps it would be better to use robust statistics: median (50% value) for average, and median absolute deviation (MAD) for dispersion.

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?

A look at terminal emulators, part 2

Posted Apr 15, 2018 17:55 UTC (Sun) by Jonimus (subscriber, #89694) [Link]

It would be interesting to see the results of the same tests but when using kmscon and fbcon. Sure they are not running under X or Wayland but in cases where latency or responsiveness are critical it would be interesting to see how much of a difference there is between the rather speedy st and just a bare console.

A look at terminal emulators, part 2

Posted Apr 15, 2018 19:22 UTC (Sun) by jhoblitt (subscriber, #77733) [Link] (15 responses)

As the screen refresh for most mass-market LCD displays is ~60hz, how would an end user even be able to perceive latency under ~16.6ms?

A look at terminal emulators, part 2

Posted Apr 15, 2018 19:42 UTC (Sun) by felixfix (subscriber, #242) [Link] (11 responses)

As an average. The difference between more chars appearing within the next refresh compared to the refresh(es) after.

A look at terminal emulators, part 2

Posted Apr 15, 2018 19:56 UTC (Sun) by jhoblitt (subscriber, #77733) [Link] (10 responses)

OK - I concede that it could delay the appearance of a character by up to ~16ms in the worst case scenario. However, I think human visual perception has lower limit of around 30ms. It would be interesting to do a blind study to see if it is possible to tell the difference between 5ms and 30ms of latency.

A look at terminal emulators, part 2

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:

  1. The minimum display time needed to trigger object recognition.
  2. The acceptable time lag between action and response - e.g. between pressing a key, and seeing the screen update with the consequences of that keypress.
  3. The maximum time for animation to count as "smooth" to the eye; i.e. the fusion threshold.

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.

A look at terminal emulators, part 2

Posted Apr 17, 2018 17:39 UTC (Tue) by tartley (subscriber, #96301) [Link] (5 responses)

This is not just a visual perception issue. The visuals are coupled to expectations based on the typing being done. Gamers all know that lag of these magnitude is very perceptible during gameplay, and has very substantial effect on both the effectiveness of a player, and the enjoyability of a game. It's really really annoying to play a game with a little lag injected! Personally when I played a lot of online FPS games, I would reject servers with more than 60ms lag as simply unplayable, but could strongly detect influences of lag down to about 20ms. I'm old (47), maybe younger folks would have even more discernment?

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.

A look at terminal emulators, part 2

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.

A look at terminal emulators, part 2

Posted Apr 17, 2018 19:37 UTC (Tue) by Cyberax (✭ supporter ✭, #52523) [Link] (2 responses)

Modern gaming monitors are 144Hz or even 244Hz on the high end, so the delay is less than 10ms for the frame display lag.

A look at terminal emulators, part 2

Posted May 21, 2018 2:46 UTC (Mon) by JanC_ (guest, #34940) [Link] (1 responses)

Assuming it doesn't have a processing pipeline (it might take longer than the display time of 1 frame to decode the image coming from HDMI and then apply whatever processing it has built-in to make it look "better" or "sharper" or whatever).

A look at terminal emulators, part 2

Posted May 21, 2018 11:32 UTC (Mon) by excors (subscriber, #95769) [Link]

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

Posted Apr 19, 2018 8:39 UTC (Thu) by jond (subscriber, #37669) [Link]

Ah, memories of FPS in the 90s... I was using dial-up for longer than I would have liked; I had to learn to be comfortable with lag around 400ms. When I finally did upgrade to cable, it took quite some re-training (I had learned to lead my shots accounting for the lag I was used to, and similar such coping strategies)

Critical fusion frequency

Posted Apr 19, 2018 10:46 UTC (Thu) by michaelkjohnson (subscriber, #41438) [Link]

Critical fusion frequency varies substantially between people and situations. Those few of us who purchased long-phosphor monochrome VGA monitors back in the day because we found standard color VGA monitors uncomfortable were (painfully!) aware of this.

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.)

A look at terminal emulators, part 2

Posted Apr 17, 2018 8:11 UTC (Tue) by flussence (guest, #85566) [Link]

I can definitely tell the difference between 30fps (33ms) and 60fps (16ms). I've used a compositor with buggy vsync that halved the framerate of apps and it was very noticeably wrong, even though I wasn't consciously looking for a problem at the time. I'll still switch browsers on a whim when they can't scroll simple pages at full speed (something I found ridiculous in 2008, let alone 2018).

A look at terminal emulators, part 2

Posted Apr 26, 2018 12:12 UTC (Thu) by nim-nim (subscriber, #34454) [Link]

Shannon/Nyquist says that you need to sample at twice the target frequency for smooth reconstruction, so if human perception is 30ms your target should be 15ms at most.

A look at terminal emulators, part 2

Posted Apr 15, 2018 20:56 UTC (Sun) by WolfWings (subscriber, #56790) [Link] (2 responses)

...that's an EXTREMELY wide brush to paint with, TBH.

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.

A look at terminal emulators, part 2

Posted Apr 16, 2018 0:13 UTC (Mon) by jhoblitt (subscriber, #77733) [Link] (1 responses)

I said "most mass-market LCD displays" intentionally; I am aware of faster refresh rates and variable refresh rate "standards" being pushed for gaming... how common do you think these are? I'd be willing to wager that it's < 1% of the Linux desktop population and probably < 0.1% for laptops. Even a high end setup may be starved for enough display port bandwidth for > 60Hz due to mst (which I think is becoming fairly popular -- even I use it).

A look at terminal emulators, part 2

Posted Apr 17, 2018 11:27 UTC (Tue) by knan (subscriber, #3940) [Link]

"Everything I look at is crap, let's optimize for crap" does not make for a quality experience for the user population that cares. The fact that you don't care does not imply everyone else should not.

A look at terminal emulators, part 2

Posted Apr 15, 2018 20:18 UTC (Sun) by xtifr (guest, #143) [Link] (3 responses)

Hmm. If Emacs is faster than most of the terminal emulators, then maybe its internal terminal emulator (M-x ansi-term) would perform better in these rankings than I would have guessed?

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
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

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

A look at terminal emulators, part 2

Posted Apr 15, 2018 20:34 UTC (Sun) by xtifr (guest, #143) [Link] (2 responses)

On the other hand, my quick-and-dirty scrolling test suggests that M-x ansi-term is more than 10x slower than xterm *or* gnome-terminal at scrolling.

So I think maybe I won't make it my *primary* terminal emulator just yet... :)

A look at terminal emulators, part 2

Posted Apr 16, 2018 16:24 UTC (Mon) by iabervon (subscriber, #722) [Link] (1 responses)

Emacs's performance characteristics are tuned more toward user-initiated changes with a high portion of the changes affecting a small part of the display, so it's not too surprising that it gets bogged down easily when multiple pages of input come in with essentially no delay.

A look at terminal emulators, part 2

Posted Apr 16, 2018 21:02 UTC (Mon) by xtifr (guest, #143) [Link]

No, that's definitely not the problem. Tried with M-x shell (which is just a buffer attached to a shell and acting like a raw tty device, rather than a proper terminal with...features), and it scrolled about 10x faster than M-x ansi-term. So the problem is in the terminal emulation code, not anything inherent in Emacs itself.

A look at terminal emulators, part 2

Posted Apr 16, 2018 0:13 UTC (Mon) by nix (subscriber, #2304) [Link] (3 responses)

As an aside, this trainwreck of a bug report thread <https://bugzilla.gnome.org/show_bug.cgi?id=664611> gives the rationale for vte's approach (Behdad is to be commended for a sensible and measured response to a frankly frothing bug reporter).

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

A look at terminal emulators, part 2

Posted Apr 17, 2018 8:43 UTC (Tue) by flussence (guest, #85566) [Link] (2 responses)

I was about to say that bug looks pretty tame, and the reporter seems to be making a mostly calm and reasonable point while the GNOME people are preemptively flipping out at him.

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.

A look at terminal emulators, part 2

Posted Apr 20, 2018 9:48 UTC (Fri) by ovitters (guest, #27950) [Link] (1 responses)

> Bit ironic that nobody gets to learn from history on a bug about infinite scrollback.

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.

A look at terminal emulators, part 2

Posted Apr 21, 2018 22:57 UTC (Sat) by nix (subscriber, #2304) [Link]

Good grief, the uncensored bug is even *more* of a trainwreck?!

A look at terminal emulators, part 2

Posted Apr 16, 2018 5:02 UTC (Mon) by ewen (subscriber, #4772) [Link]

Possibly of note, 20ms (mentioned as latency added by GNOME) is 1/50th of a second, ie frame refresh at 50Hz. Possibly there's some double/triple buffering and sync-to-frame-start going on there, at least by the time a screen compositor has become involved. IIRC LCD panels themselves also potentially have their own buffering before output (noticeable in video/audio sync on playback -- sometimes the audio needs to be slightly delayed to account for this compared with output to a traditional CRT; IIRC HDMI into LCD television panels is one case where this may need to be taken into account).

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

History problems

Posted Apr 16, 2018 12:35 UTC (Mon) by HenrikH (subscriber, #31152) [Link] (5 responses)

Not related to the latency of course but I've noticed that the command history in both xterm and Gnome Terminal (or might it be in bash itself?) botches completely if a command is very large. Noticed this on a big MySQL query but it have nothing to do with MySQL.

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.

History problems

Posted Apr 16, 2018 13:09 UTC (Mon) by murukesh (subscriber, #97031) [Link] (4 responses)

Sounds like what happens when your PS1 prompt doesn't properly account for non-printing characters.

History problems

Posted Apr 17, 2018 8:56 UTC (Tue) by flussence (guest, #85566) [Link] (2 responses)

I had to help someone with exactly this the other day, so here's the solution just in case: enclose each "\e..." sequence in $PS1 in \[...\]. Some of them may already be terminated with \], and it'll mostly appear to work with only that until you get weird edge cases like this, but the brackets do need to be balanced.

History problems

Posted Apr 19, 2018 9:12 UTC (Thu) by HenrikH (subscriber, #31152) [Link]

I use the default Ubuntu PS1 of "\[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}\u@\h:\w\$"

History problems

Posted Apr 19, 2018 19:40 UTC (Thu) by JFlorian (guest, #49650) [Link]

I've encountered accounting problems for non-space taking chars in PS1 even with correctly balanced escapes. It seems bash has had bugs on and off here. I've not seen it recently but in the last few years it was quite regular. I got the impression it was related to vi-mode as it was usually during history manipulation that things went awry.

History problems

Posted Apr 19, 2018 9:11 UTC (Thu) by HenrikH (subscriber, #31152) [Link]

My PS1 is the Ubuntu standard and have no special characters at all: "henrik@ubuntu:~$" so this is something different

reproducible results

Posted Apr 16, 2018 22:09 UTC (Mon) by anarcat (subscriber, #66354) [Link] (2 responses)

As with the previous article, I have published extensive documentation on the process by which those benchmarks were created here:

https://gitlab.com/anarcat/terms-benchmarks

... with a (potentially out of date) mirror on GitHub here:

https://github.com/anarcat/terms-benchmarks

reproducible results

Posted Apr 16, 2018 22:11 UTC (Mon) by anarcat (subscriber, #66354) [Link]

and i forgot to mention, of peculiar interest might be the notebook which was used to generate those graphs:

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...

reproducible results

Posted Apr 19, 2018 19:45 UTC (Thu) by JFlorian (guest, #49650) [Link]

I did not see mentioned anywhere that said how the scrollback history was configured to be as equivalent as possible between the various products. It seems likes this could have a significant effect on the needed resources.

A look at terminal emulators, part 2

Posted Apr 17, 2018 15:37 UTC (Tue) by mirabilos (subscriber, #84359) [Link] (27 responses)

I’ve seen xterm need more memory when Unicode fonts, as opposed to fonts for an 8-bit charset, are used. (When not precompiled into .pcf, .bdf parsing additionally takes up a second or two on my IBM X40.)

A look at terminal emulators, part 2

Posted Apr 17, 2018 15:47 UTC (Tue) by anarcat (subscriber, #66354) [Link] (26 responses)

That would definitely explain the results I had on my normal setup, where I used the following .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...

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.

A look at terminal emulators, part 2

Posted Apr 17, 2018 15:51 UTC (Tue) by sfeam (subscriber, #2841) [Link]

"(e.g. this is fire! 🔥)" displays correctly in konsole.

A look at terminal emulators, part 2

Posted Apr 17, 2018 16:27 UTC (Tue) by zdzichu (subscriber, #17118) [Link] (2 responses)

tilix-1.7.7-1.fc28.x86_64
vte3-0.36.5-6.fc28.x86_64

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).

A look at terminal emulators, part 2

Posted Apr 17, 2018 16:35 UTC (Tue) by anarcat (subscriber, #66354) [Link] (1 responses)

Sigh... neither of those (konsole, tilix) work here (Debian stretch). I always find it puzzling to see things work in a web browser and then not in a terminal... Maybe my desktop is getting old...?

A look at terminal emulators, part 2

Posted Apr 28, 2018 15:25 UTC (Sat) by flussence (guest, #85566) [Link]

Web browsers cheat. Firefox bundles an emoji font (which they're now marooned on an old version of, because upstream doesn't "get" FOSS and made newer versions proprietary) and a patched version of fontconfig/freetype/whatever that displays it in colour.

A look at terminal emulators, part 2

Posted Apr 17, 2018 16:30 UTC (Tue) by mirabilos (subscriber, #84359) [Link] (20 responses)

That would be a Truetype font, they have even worse penalties… at least bitmap fonts are limited to the Basic Multilingual Plane and use an unsigned short for glyph indexing (which is why you’ll never have emoji with them).

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.

A look at terminal emulators, part 2

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.)

A look at terminal emulators, part 2

Posted Apr 28, 2018 21:44 UTC (Sat) by cm7 (guest, #124032) [Link] (18 responses)

Sounds interesting, is your misc-fixed fork available somewhere?

Are 9x18/18x18 supposed to part of the default aliases when one installs misc-fixed? I can't find them.

A look at terminal emulators, part 2

Posted Apr 28, 2018 22:24 UTC (Sat) by mirabilos (subscriber, #84359) [Link] (17 responses)

Oh, cool, thanks for your interest!

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).

A look at terminal emulators, part 2

Posted Apr 28, 2018 23:00 UTC (Sat) by cm7 (guest, #124032) [Link] (14 responses)

Cool, stuff to test. What I always wanted but never found and failed to generate with Fontforge is 12x22 PCF for xterm. Both fixed and 12x22 are missing DIN legibility improvements (you know zero vs oooh etc), but most importantly, misc-fixed is too light. A little more weight and I could use it. The weight of Fira Mono has spoiled me since it's not bold and neither slim, just right. Opinions and pointers welcome.

I'll try the files you linked, thank you!

A look at terminal emulators, part 2

Posted Apr 28, 2018 23:59 UTC (Sat) by mirabilos (subscriber, #84359) [Link] (8 responses)

Hm, I did not know there are DIN legibility thingies, but I absolutely require my zeroes slashed from bottom-left to top-right (already kicked up a fuss because in Teχ/LᴬTᴇX they were slashed the wrong way, and ever since DOS 5 cp850, the zero is often dotted, if at all.

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).

A look at terminal emulators, part 2

Posted Apr 29, 2018 0:22 UTC (Sun) by cm7 (guest, #124032) [Link] (1 responses)

A look at terminal emulators, part 2

Posted Apr 29, 2018 16:35 UTC (Sun) by mirabilos (subscriber, #84359) [Link]

Thanks a lot for the hints!

I’ve adjusted all ‘l’ in the 9x18 and the one in the 18x18 font.
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

Posted Apr 29, 2018 0:24 UTC (Sun) by cm7 (guest, #124032) [Link] (2 responses)

Will there be a conflict if I put the distro provided fixed-misc and MirOS PCFs in the font path? I haven't figured out how to map xlsfonts entries to file paths which is easy for stuff managed by fontconfig.

A look at terminal emulators, part 2

Posted Apr 29, 2018 0:30 UTC (Sun) by cm7 (guest, #124032) [Link] (1 responses)

I guess not since the foundry is miros. xlsfonts doesn't list the selections you mention above, but I guess I can work them out via xfontsel.

A look at terminal emulators, part 2

Posted Apr 29, 2018 16:49 UTC (Sun) by mirabilos (subscriber, #84359) [Link]

If you go from CVS, run “fixedmir.sh” (make sure mksh and ed are installed and bdfctool is in the PATH (or replace it by “mksh /path/to/bdfctool.sh” when just using bdfctool from the CVSweb link I gave you).

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.

A look at terminal emulators, part 2

Posted Apr 29, 2018 0:42 UTC (Sun) by cm7 (guest, #124032) [Link] (2 responses)

Is that a fork of Raph's Inconsolata? Either way, I can't work with it due to the small height of { and }. It breaks code legibility when [ and { are different heights.

A look at terminal emulators, part 2

Posted Apr 29, 2018 16:45 UTC (Sun) by mirabilos (subscriber, #84359) [Link] (1 responses)

It’s actually a not-fork of the Teχ/LᴬTᴇX version of the font, just realising the OpenType features that the inconsolata.sty parameters “varl” and “varq” enable, since almost all programs don’t do OpenType features. (The Teχ/LᴬTᴇX one is a version of Raph Levien’s, but changed, and AIUI also based on an older version and never rebased, but I don’t see insurmountable problems with it except for the small glyph count; as I said, I use it in environments that don’t support bitmap fonts like IntelliJ and Android.)

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.

A look at terminal emulators, part 2

Posted May 7, 2021 22:46 UTC (Fri) by mirabilos (subscriber, #84359) [Link]

I fixed (hah) the curly brace in FixedMisc [MirOS] and will be doing a proper fork of Inconsolata later when I have time, in which I’ll fix that too.

A look at terminal emulators, part 2

Posted Apr 29, 2018 0:00 UTC (Sun) by cm7 (guest, #124032) [Link] (3 responses)

So something like terminus with a mix of Sun's 12x22 and misc-fixed's style mashed together without the huge size of 12x22 but the weight of it, maybe.

A look at terminal emulators, part 2

Posted Apr 29, 2018 0:21 UTC (Sun) by mirabilos (subscriber, #84359) [Link] (2 responses)

Terminus is an option, as is 9x18B from Fixed [Misc].

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).

A look at terminal emulators, part 2

Posted Apr 29, 2018 0:36 UTC (Sun) by cm7 (guest, #124032) [Link] (1 responses)

Should there be an 9x18bold alias with default xorg fixed package? I mean, is it a bug?

A look at terminal emulators, part 2

Posted Apr 29, 2018 16:36 UTC (Sun) by mirabilos (subscriber, #84359) [Link]

No, only a few of these fonts even have aliases, and they are historically caused.

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).

A look at terminal emulators, part 2

Posted Apr 29, 2018 0:01 UTC (Sun) by mirabilos (subscriber, #84359) [Link]

Oh, and I agree Fixed [Misc] (and thus FixedMisc [MirOS]) being too slim. It took me years to get used to it, and it only works well because I stick with Thinkpad X40 and X61 12″ screens.

On the plus side, it *does* have 50105 glyphs readily available…

A look at terminal emulators, part 2

Posted Apr 28, 2018 23:05 UTC (Sat) by cm7 (guest, #124032) [Link] (1 responses)

Could you possibly consider publishing BDF of MirOS-FixedMisc? I'll admit I'm too lazy to set up MirOS to go from bdfc -> bdf and then bdf -> pcf. I'd appreciate that very much.

A look at terminal emulators, part 2

Posted Apr 28, 2018 23:22 UTC (Sat) by cm7 (guest, #124032) [Link]

I mean to have newer version than those in the deb since you mentioned that CVS has important updates not found in old snapshots.

A look at terminal emulators, part 2

Posted Apr 17, 2018 23:43 UTC (Tue) by xtifr (guest, #143) [Link]

'(e.g. this is fire! 🔥)' displays fine in Gnome Terminal too. At least on my system. Maybe it's your fonts? I'm using DejaVu Sans Mono Book.

A look at terminal emulators, part 2

Posted Apr 18, 2018 20:31 UTC (Wed) by bobbytables (guest, #65908) [Link] (2 responses)

Thank you for these articles.

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.

A look at terminal emulators, part 2

Posted Apr 18, 2018 20:46 UTC (Wed) by bobbytables (guest, #65908) [Link] (1 responses)

A question to the author, did you use the Async method for testing (which is off by default)?
With that on, my scores improve 50%, although at 7 ms avg on xterm + vim is the minimum I could get.

A look at terminal emulators, part 2

Posted Apr 18, 2018 21:15 UTC (Wed) by anarcat (subscriber, #66354) [Link]

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

Posted Apr 19, 2018 10:57 UTC (Thu) by mezcalero (subscriber, #45103) [Link] (3 responses)

Who cares about performance of a terminal emulator, if it can't draw emojis? I mean, please, let's focus on the important things, and I take emojis a thousand times over frickin' speed, thank you very much...

😬 😬 😬

A look at terminal emulators, part 2

Posted Apr 27, 2018 16:55 UTC (Fri) by Tara_Li (guest, #26706) [Link]

... This explains *MUCH*.

A look at terminal emulators, part 2

Posted May 4, 2018 9:41 UTC (Fri) by mgedmin (subscriber, #34497) [Link] (1 responses)

Heh, I switched *browsers* because Chromium cannot render emoji in full color in Ubuntu 18.04 LTS, but Firefox can.

A look at terminal emulators, part 2

Posted May 5, 2018 17:29 UTC (Sat) by flussence (guest, #85566) [Link]

Would be nice if the Mozilla Corporation would bother to upstream their changes to the font rendering stack, instead of hoarding it just to give their competitor a black eye…

Gnome Response Times are set to 0.1 second, not 10 ms

Posted Apr 26, 2018 7:46 UTC (Thu) by Jiehong (guest, #109656) [Link]

Hello,

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.

A look at terminal emulators, part 2

Posted Apr 26, 2018 12:56 UTC (Thu) by dcg (subscriber, #9198) [Link] (2 responses)

Measuring memory usage by just looking at RSS? Really?

A look at terminal emulators, part 2

Posted Apr 26, 2018 14:33 UTC (Thu) by zlynx (guest, #2285) [Link]

I'm not sure what you think is better?

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.

Measuring memory usage by looking at RSS

Posted Apr 27, 2018 12:31 UTC (Fri) by darwish (guest, #102479) [Link]

>> Measuring memory usage by just looking at RSS? Really?

Hmm, that's exactly what I did for PulseAudio three years ago. What else would you propose?

A look at terminal emulators, part 2

Posted Apr 26, 2018 21:45 UTC (Thu) by jspricke (guest, #123988) [Link] (3 responses)

You can easily get st down to 5-7ms latency by tuning the fps settings in config.h.
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

setting xfps and actionfps to 1000
https://git.suckless.org/st/tree/config.def.h#n45
st 0.8.1, exec fish: 3.1 11.2 6.8 1.8

xfps == fps == 5000
st 0.8.1, exec fish: 3.2 10.8 5.8 2.0

setting dodraw = 1
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

Posted May 3, 2018 13:26 UTC (Thu) by idhx (guest, #124131) [Link]

Increasing the fps setting does lead to vast improvements. Thanks.

What does dodraw do?

A look at terminal emulators, part 2

Posted Dec 16, 2019 14:50 UTC (Mon) by life@1ms (guest, #136139) [Link]

Interesting... So st is the lowest latency if you take the FPS setting into account? Are there other emulators with FPS settings? Would be good to see LWN redo these tests with the correct settings enabled for optimal performance.

I wonder why your dash is the slowest when these guys seem to be saying it is the fastest:
https://github.com/fish-shell/fish-shell/issues/2776
or is mksh the fastest?

A look at terminal emulators, part 2

Posted Jan 4, 2021 15:04 UTC (Mon) by life@1ms (guest, #136139) [Link]

Those links don't contain the same material anymore it seems... I'll assume these 2 patches achieve all of the same stuff unless you say otherwise ;)
https://st.suckless.org/patches/sync/

Scrollback to disk?

Posted Apr 27, 2018 14:02 UTC (Fri) by sgourichon (guest, #88605) [Link]

> 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.

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
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")

> 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.

A look at terminal emulators, part 2

Posted Apr 28, 2018 20:50 UTC (Sat) by CycoJ (guest, #70454) [Link]

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

Posted Nov 25, 2018 6:49 UTC (Sun) by sabrehagen (guest, #128824) [Link]

Thanks for a credible, and incredible article. Now that alacritty has released their major 2.0 rework, would you be interested in seeing how it compares to the version you tested? https://github.com/jwilm/alacritty/releases

A look at terminal emulators, part 2

Posted Apr 2, 2024 20:04 UTC (Tue) by Kana (guest, #170579) [Link]

I think it would be very informative to tell anyone who reaches this page that the Urxvt latency can be greatly reduced by configuring its refresh rate.
For example, in my machine if I place "Rxvt*refreshRate: 200" in ~/.Xdefaults, the latency falls from 18ms to 5ms.


Copyright © 2018, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds