News for hackers. Stuff that matters.
Re:iTerm2 3.3 by IfOnlyYouKnew on Thursday August 01, 2019 @03:39PM (#20587488)
Here's some comparison of input lag:

    # Title              Min    Max   *Avg*   SD
    1 iTerm 3.3.0beta16  11.2   33.6   15.9  3.4
    2 iTerm 3.2.9        10.8   29.5   21.3  4.5
    3 hyper 3.0.2        22.3   46.9   27.6  3.6
    4 Terminal 2.9.1      2.4    8.3    5.8  0.5
    5 Alacritty 0.3.3     5.2   16.8    6.3  1.4
    6 Kitty 0.14.3        7.7   11.6    9.6  0.8
Measured using https://github.com/pavelfatin/typometer

Edit: Added iTerm 3.2.9 (2) added alacritty (3) added Kitty

Re:iTerm2 3.3 by sonthonax on Thursday August 01, 2019 @05:35PM (#20588596)
Could someone explain to me terminal performance and what these numbers practically mean? It's a complete mystery to me. It's so incredibly variable, the fact that I notice variability as a user really perturbs me, it's 2019, and displaying a matrix of a few thousand characters is still a challenge.

I live in fullscreen iTerm, Tmux and Vim. I have 256 colours enabled. Vim has lazy redraw enabled. I'm on a 2018 MacBook pro. Scrolling is smooth only when connected to power (probably related to CPU throttling - but it's 2019 and it shouldn't matter). iTerm is significantly faster than Terminal when resizing Tmux panes and Vim windows. I've had similar issues on Linux.

The only terminal emulator that has decent performance scrolling and resizing Vim buffers Alacritty.

What's going on? Why is there a bottleneck here? Is it rendering the text? Is that still hard to do in 2019? I don't understand the technical challenge of parsing a protocol that would literally work on a real VT100 sans some escape sequences and colours.

Re:iTerm2 3.3 by txcwpalpha on Thursday August 01, 2019 @06:30PM (#20588974)
> Scrolling is smooth only when connected to power (probably related to CPU throttling - but it's 2019 and it shouldn't matter).

This likely isn't CPU throttling at all. iTerm by default uses the faster Metal renderer when your MBP is plugged in, and a different renderer when not. You can adjust this so that it always uses Metal by following the instructions on this page: https://gitlab.com/gnachman/iterm2/wikis/Metal-Renderer

If you live full time inside iTerm, I would highly recommend reading over the documentation and becoming fully familiar with the different aspects of it and what you can tweak. Despite it being something that merely "displays a matrix of a few thousand characters", it is still a very complex piece of software and knowing at least a basic level of its configuration will likely be worth it.

Re:iTerm2 3.3 by IfOnlyYouKnew on Thursday August 01, 2019 @09:16PM (#20589954)
There are (at least) two different things people mean when talking about terminal performance. What's measured above is latency, i. e. the time from keypress to the letter appearing on screen. I must say I rarely actively notice any delay, except when the system is slow or I'm working remotely and the delay is above, say, 1/3 of a second. I was, however, surprised by how notable no delay can be if you ever get to experience it. In my case, this was typing in an UEFI shell. I can't measure the delay there, and it's surprising that the difference from 5.0ms to, at best, 0ms is noticeable at all.

There is also throughout. Some programs have real problems rendering large amounts of output, i. e. when tail'ling logs. This was a significant problem with Hyper, for example, but they have changed the backend library and it's fine now. I believe the reason here is usually a lack of bouncing, i. e. rendering for every new character even if they arrive faster than the refresh cycle.

It's not entirely unreasonable that rendering takes some time. Terminals have evolved and, as but one example, character widths now vary even when using monospaced fonts (non-ascii characters, emojis, whatever). Then, there are fancy additions like ligatures, transparency effects, etc.

Re:iTerm2 3.3 by jakear on Thursday August 01, 2019 @05:56PM (#20588755)
I have found iTerm to have very bad performance relative to Terminal.app. I honestly have no clue why its so popular, I cannot stand it.
Re:iTerm2 3.3 by kmundnic on Thursday August 01, 2019 @07:32PM (#20589364)
For me it's about using tmux with the same commands as the native iTerm2 commands to split panes and other tasks. That way I can work on a server in the same way I work on my machine.
Re:iTerm2 3.3 by Abishek_Muthian on Friday August 02, 2019 @05:21AM (#20591633)
Metal based iTerm2 on a low power intel CPU is one thing which doesn't make me miss Linux terminal on MacOS. I've put up a dedicated display for it and functions seamlessly.

Please try to explain your performance issues, the author is active on HN and perhaps he could comment on it.

Re:iTerm2 3.3 by jbverschoor on Thursday August 01, 2019 @07:45PM (#20589443)
For me it’s only 1 feature: the profiles window. I configure them as ssh to hosts. And then I have a decal/text in the corner + a color in the bg. But most importantly is the favorites manager
Re:iTerm2 3.3 by uberduper on Thursday August 01, 2019 @11:44PM (#20590535)
I do this in my ssh config to get what I assume is the same effect with the iTerm badge.

  Host * !github.com
    LocalCommand printf '\e]7;file://%n/\a'
    PermitLocalCommand yes
Re:iTerm2 3.3 by dijit on Thursday August 01, 2019 @05:57PM (#20588769)
I agree with you, or, I did, until they switched to the metal renderer. Now iTerm is as fast as terminal.app (provided you use the same settings)
Re:iTerm2 3.3 by bradknowles on Thursday August 01, 2019 @07:47PM (#20589465)
So, in this case, why would I prefer iTerm over Terminal.app?

Seriously, I don't understand what the benefits are, if it's only "just as fast as Terminal.app".

Re:iTerm2 3.3 by ShamelessC on Thursday August 01, 2019 @08:23PM (#20589678)
It has quite a few nice features that Terminal doesn't have. But yeah, if you don't need those features then just use Terminal.
Re:iTerm2 3.3 by dijit on Friday August 02, 2019 @04:43PM (#20596471)
Speed is secondary. iTerm has much richer features, even the hotkeys are super nice.

But among those features is tmux integration and now python extension support.

Re:iTerm2 3.3 by Cort3z on Thursday August 01, 2019 @08:31PM (#20589724)
iTerm has very many features that are great for productivity which the default Terminal.app does not have.
Re:iTerm2 3.3 by phailhaus on Friday August 02, 2019 @09:02AM (#20592612)
Did you read the release notes for 3.3? How many of those features are supported by Terminal.app?
Re:iTerm2 3.3 by rodorgas on Thursday August 01, 2019 @09:10PM (#20589926)
I think that iTerm is prettier. The font rendering looks better to me.
Re:iTerm2 3.3 by liability on Thursday August 01, 2019 @09:00PM (#20589879)
It supports a 'quake mode', which is the only reason I use it.
Re:iTerm2 3.3 by alextooter on Thursday August 01, 2019 @10:33PM (#20590313)
Agree,I set the same key as in Quake,and full screen console drop down,which is very cool.
Re:iTerm2 3.3 by yoz-y on Friday August 02, 2019 @04:02AM (#20591330)
For me it is the Quake mode and triggers so I can turn output of the many tools I use into coloured and functioning URLs. (E.g. bug ids, pull requests and so on)
Re:iTerm2 3.3 by sys_64738 on Thursday August 01, 2019 @09:48PM (#20590113)
Tmux integration.
Re:iTerm2 3.3 by tazard on Friday August 02, 2019 @12:00AM (#20590581)
Is that really a nice feature? I live in tmux + iTerm, and have set up the integration but never really used/enjoyed is so I just disabled it. Not sure what I'm missing honestly
Re:iTerm2 3.3 by uberduper on Thursday August 01, 2019 @07:23PM (#20589305)
Give neovim a try. Along with iterm gpu rendering, it's quite fast even with syntax highlighting and cursorline.

IIRC iterm2 has a setting to disable gpu rendering while on battery which is almost certainly your issue.

Re:iTerm2 3.3 by wyclif on Thursday August 01, 2019 @08:10PM (#20589593)
If you know how to set it up, iTerm2 + NeoVim + tmux + zsh is a pretty tasty combination.
Re:iTerm2 3.3 by emmelaich on Thursday August 01, 2019 @09:29PM (#20590017)
Do you have syntax on in Vim?

It can be super slow. I've compared scrolling in Vim and Emacs on the same (large) json file and Vim is painful and Emacs is almost immediate.

Re:iTerm2 3.3 by deathanatos on Thursday August 01, 2019 @11:13PM (#20590453)
> displaying a matrix of a few thousand characters is still a challenge.

> I don't understand the technical challenge of parsing a protocol that would literally work on a real VT100 sans some escape sequences and colours.

We definitely ask a lot more of a terminal today then we did of a VT100.

First, it's not really a grid anymore: double-width CJK characters and emoji break that assumption a bit (though it still holds if you just consider them as 2-column glyphs). Our fonts are nicer: we have vectors not bitmaps, anti-aliasing, ligatures, combining accents. Color, but also effects like bold/italics. iTerm2 is also capable of images (even before this release, which added sixel graphics; it can output some other format (PNG?) with a special escape.) iTerm2 will dynamically wrap lines (it remembers where actual ␤ chars are, and if you resize, it can re-wrap the lines appropriately). It can pick out URLs, and make them easily clickable/copyable. It tracks the timestamp of each line of output (press ⌘⇧E by default, or View → Show Timestamps). And it's doing this on top of an OS that is also mux'ing your display out to multiple applications (windows), shared with the same CPU that is driving the programs emitting the output into the terminal (it's not dedicated hardware).

And the terminal protocol is not really simple… some aspects of it rely on how fast input comes from (this only happens on the input side, I think, and there's a varieties of "if this, then this sequences means X, otherwise it means Y".

I too would ask for better perf from iTerm2 (I get much better perf from Terminator on Linux — but it doesn't have quite the featureset that iTerm2 has, I think) but I do think that there's a lot more going on than one might give the emulator credit for.

> The only terminal emulator that has decent performance scrolling and resizing Vim buffers Alacritty.

I've not used Alacritty, but my understanding is that it (intentionally) has a much narrower feature set to support. (I personally prefer something feature-ful like iTerm2.)

> I'm on a 2018 MacBook pro.

I've actually wondered if this is part of it. I get low perf from not just iTerm2, but my system in general. I've looked for, and not really found, a way to see what the core temps are (I've mostly found this, but the numbers are rough) and whether it is being thermally limited (I have no idea). The MBP's limited intake/exhaust areas just feel to me that they would significantly limit the thing's ability to dissipate heat. (E.g., my Lenovo has much more surface dedicated to airflow, and I seem to get better perf from it. The Lenovo also gets hotter too, so… IDK. But it also runs Linux and Terminator, so it's hardly an apples-to-apples comparison.)

Re:iTerm2 3.3 by chipotle_coyote on Thursday August 01, 2019 @04:40PM (#20588114)
This does lend credence to my perception that Terminal is faster. I know everybody else love love loves iTerm2, but I could never get past the feeling of "ugh I am typing in molasses what is going on here." Later versions have been better, but later versions of Terminal have also had more functionality. It's possible I still don't know what I'm missing, but so far the must have features I've tried apparently just weren't ones I must have. (Yes, I know about split panes, but I can run tmux. Yes, I know about iTerm2's tmux integration and I tried it and it was kind of [shrug emoji] for me, I dunno. Terminal has a find-on-page feature and I so far haven't been saddened it doesn't support regex. My shell has autocomplete and iTerm hasn't sold me on its implementation being better. Alfred has a clipboard history and iTerm hasn't sold me on its implementation being better. And so on.)
Re:iTerm2 3.3 by fiddlerwoaroof on Friday August 02, 2019 @01:09AM (#20590767)
The killer features of iterm for me are three:

1. Built in password manager (command-alt-f) for the Times you’re stuck with ssh passwords

2. Output triggers: iterm can run actions in response to certain text on stdout: I use this to insert a mark at each terminal prompt line and when the phrase “NOTICE ME:” is detected. This way, I can use iterm’s mark navigation features to quickly jump to interesting lines

3. Finally, the biggest advantage of iterm is its ability to auto detect soft boundaries like vim vertical splits and restrict selection to one side or the other of the split.

Re:iTerm2 3.3 by Cort3z on Thursday August 01, 2019 @08:40PM (#20589781)
It might not be for you, but I would recommend reading through this https://www.iterm2.com/documentation-highlights.html

I personally find the following either cool or really productive;

Open Quickly, Undo close, Triggers, Smart Selection, Instant Replay, Regular Expression Search, Save Mark/Jump to Mark

Re:iTerm2 3.3 by dorian-graph on Friday August 02, 2019 @03:33PM (#20595893)
I've spent at least 6+ straight months on iTerm2 3.x, kitty, and Alacritty (my current primary terminal), and briefly tried Terminal. Terminal is waaay faster. The only thing that's stopping me from using it as my primary terminal is the poor colour support and poor split window support (and setting shortcuts to go between them).
Re:iTerm2 3.3 by djhworld on Thursday August 01, 2019 @04:21PM (#20587931)
Could you test Alacritty too? https://github.com/jwilm/alacritty
Re:iTerm2 3.3 by IfOnlyYouKnew on Thursday August 01, 2019 @04:48PM (#20588202)
done
Re:iTerm2 3.3 by Peter-Jan on Thursday August 01, 2019 @04:01PM (#20587728)
I am running a relatively barebones version of st(https://github.com/Peter-JanGootzen/st) and am getting these numbers on a modern machine.

    # Title Min Max Avg SD
    1 st 12.6 38.1 20.7 6.8
I am quite suprised how low your numbers are(eventough I am aware that comparing between machines is probably unreliable), especially Hyper because my experience with it was that it was really slow compared to other terminal emulators.
Re:iTerm2 3.3 by penagwin on Thursday August 01, 2019 @04:03PM (#20587742)
If you have the time could you test both alacritty and hyper?
Re:iTerm2 3.3 by dsissitka on Thursday August 01, 2019 @05:04PM (#20588358)
I tested them a few months ago:

https://news.ycombinator.com/item?id=19456146

Re:iTerm2 3.3 by ksaj on Sunday August 04, 2019 @11:12PM (#20610889)
Is it an OS version issue? I haven't updated my OSX in ages (mainly because I don't like the direction its going, and updating seems to be guaranteed to fuck up my Logic Audio install like it does every damn time), and iTerm runs amazingly smoothly on it as is. I feel no lag with it and I spend a lot of time on the command line (Lisp programmer on vim ... go figure...), so I'm wondering if these numbers even matter after a certain point, or if later OSX versions are doing something crappier than the usual.
Re:iTerm2 3.3 by Rebelgecko on Thursday August 01, 2019 @04:49PM (#20588220)
Was that with or without the GPU rendering enabled?
Re:iTerm2 3.3 by IfOnlyYouKnew on Thursday August 01, 2019 @09:00PM (#20589875)
Enabled in Iterm2, whatever the default configuration is for the others.
Re:iTerm2 3.3 by mikeash on Thursday August 01, 2019 @04:47PM (#20588193)
Measuring the time between a simulated keypress and pixels changing in the framebuffer seems kind of inadequate, since it’s missing out on delays in the input and display hardware.
Re:iTerm2 3.3 by trufas on Thursday August 01, 2019 @04:55PM (#20588268)
The hardware should be the exact same between all terminals right? It seems accounting for that would only add noise.
Re:iTerm2 3.3 by giobox on Thursday August 01, 2019 @05:11PM (#20588402)
In many cases the display lag can be one of the biggest sources of input lag, often dwarfing the sub 20-30 ms lag times the earlier post measured across iTerm and it’s alternatives.
Re:iTerm2 3.3 by apetresc on Thursday August 01, 2019 @04:55PM (#20588264)
Surely that would affect all the applications being compared equally, though?
Re:iTerm2 3.3 by mikeash on Thursday August 01, 2019 @05:16PM (#20588439)
Not necessarily. For example, if one app synchronizes with screen refresh and another does not, the latter will perform much better on this test but it’s not actually getting the changes to your eyes any faster.

It would also just be nice to know the magnitudes. If the hardware adds a constant 100ms (for example, not a real number) then a 10ms advantage on the software side looks less interesting.

Re:iTerm2 3.3 by j605 on Thursday August 01, 2019 @04:27PM (#20587991)
After testing it feels Kate has similar numbers as Terminal mentioned here but most emulators are just as slow. The minimal ones are actually worse off.
Re:iTerm2 3.3 by capnahab on Saturday August 03, 2019 @06:36AM (#20599688)
Are these milliseconds? The visual evoked response latency ( time taken from the eye to electrical activity in the occipital cortex ) is about 88 ms in Women and 92 ms in men. There will be additional time for the visual object ( eg cursor) to be processed and appreciated in higher centres.
Re:iTerm2 3.3 by capnahab on Saturday August 03, 2019 @01:12PM (#20601463)
So we are unable to differentiate speed of anything appearing on screen of less than about 100ms, making this benchmarking of academic interest only.

https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4572953/

Re:iTerm2 3.3 by warvair on Thursday August 01, 2019 @06:11PM (#20588857)
Pease test ZOC Terminal: https://www.emtec.com/zoc/.

I use it on Windows, like it very much, and don't notice any lag. I'm wondering how it compares to the rest of these on a Mac.

Re:iTerm2 3.3 by IfOnlyYouKnew on Thursday August 01, 2019 @09:02PM (#20589889)

    # Title     Min     Max     Avg     SD
    1 Zorc      2.9    33.2    12.5    5.6
Quite fast, but feels a bit like it's 1999 again otherwise.
Re:iTerm2 3.3 by warvair on Thursday August 01, 2019 @09:32PM (#20590031)
Thanks!
Re:iTerm2 3.3 by TimTheTinker on Thursday August 01, 2019 @07:42PM (#20589423)
I can see how that would be a great solution on Windows, since there's no decent built-in TTY (prior to recent builds of Windows 10). It's advertised as an "ssh client" which is great there.

But I don't know why anyone would choose to use that on a Mac. The UI requires initiating connections to remote systems (or "localhost") through the GUI -- which feels really backward when you can just open a new window/tab on any other terminal app (for local tty sessions) or run ssh from the command line (for remote sessions).

Re:iTerm2 3.3 by warvair on Thursday August 01, 2019 @09:46PM (#20590105)
I wasn't even thinking about local term vs. remote until you mentioned it, but you're right.

I guess it's because I don't use a Mac very often and when I do I don't usually have a reason to use the local terminal. I find that's true on Windows as well, I don't often need to use the command line.

OTOH, I'm SSHed into remote Linux servers 40+ hours a week.

Re:iTerm2 3.3 by norswap on Friday August 02, 2019 @06:45PM (#20597285)
Is that milliseconds? Aren't those values in the non-noticeable range? I tracked a paper recently saying that users don't notice feedback for less than ~96ms (a bit less in some scenarios).
Re:iTerm2 3.3 by penagwin on Thursday August 01, 2019 @03:58PM (#20587687)
I'm I reading that right that the input lag has increased on average? And while the minimum might have improved by .4 or is within measurement error?
Re:iTerm2 3.3 by flypaca on Thursday August 01, 2019 @04:00PM (#20587714)
The minimum data point for iTerm 3.2.9 have shifted towards the left. Overall the 3.3 has better average.
Re:iTerm2 3.3 by penagwin on Thursday August 01, 2019 @04:02PM (#20587734)
It's average is still ~6ms higher though?
Re:iTerm2 3.3 by trca on Thursday August 01, 2019 @04:22PM (#20587940)
The 3.3 average is ~6ms faster...
Re:iTerm2 3.3 by egwor on Thursday August 01, 2019 @04:25PM (#20587971)
The columns aren't aligned quite right. That's what I (mis)read too.
Re:iTerm2 3.3 by ihuman on Thursday August 01, 2019 @04:03PM (#20587748)
Is the average for iTerm 3.2.9 supposed to be 24.5, not 4.5?
Re:iTerm2 3.3 by viraptor on Thursday August 01, 2019 @04:09PM (#20587816)
The text is shifted. Min starts before its column. 4.5 is the sd.
Re:iTerm2 3.3 by IfOnlyYouKnew on Thursday August 01, 2019 @04:48PM (#20588206)
fixed, sorry
Re:iTerm2 3.3 by dgrabla on Thursday August 01, 2019 @04:41PM (#20588138)
Can you test Kitty as well?