Is there any way to reduce latency when typing things? It is not super slow, but noticeably slower than any other terminal that I use.
It feels like I'm typing on ssh terminal.
I don't see that latency here 馃槹
Neither do I. @indutny can you record a video with your mobile phone?
there are tools to objective latency measurement
https://pavelfatin.com/typing-with-pleasure/
in russian http://tonsky.livejournal.com/306545.html
@iamstarkov 馃憤
Just wrote a small C application to measure latency. Turns out HyperTerm is actually faster than iTerm2. My bad!
Still would be cool if anyone else would be able to confirm it independently. I am not absolutely sure that my tool is correct.
(The tool is here)
Here is updated bench with the latency of typing in this comments form (just for fun):
Though, may be HyperTerm just became faster since last time? :) Have you done anything about performance?
Can you publish that C app here at GitHub? I'm interested in how it works 馃槉
@matheuss I already did in a comment above. Here it is just in case: https://gist.github.com/indutny/b530593a996bbbe8bfd51fc3f38c45f2
Oh, my bad 馃槄 Thanks!
Still would be cool if anyone else would be able to confirm it independently.
My observations (subjective) are that HyperTerm has noticeably less latency as I type than iTerm2 but in my case I know a lot of that is due to my zsh config which causes a lot of redrawing as I type.
Though, may be HyperTerm just became faster since last time? :) Have you done anything about performance?
There have been a couple of updates of electron
in the HyperTerm package. The most recent one 1.3.0
updates Chrome to version 52
and node to 6.3.0
. So there may be some performance improvements just from that.
There are certainly _some_ actions at which HyperTerm can be slow. Typing in a new prompt is certainly not one of them (as shown above :P), but we have to consider a lot of different scenarios (like large screen redraws).
@freebroccolo
There have been a couple of updates of electron in the HyperTerm package. The most recent one 1.3.0 updates Chrome to version 52 and node to 6.3.0. So there may be some performance improvements just from that.
This must be it. I wish I had an old version to compare to.
Decided to publish my tool as a separate repo with build instructions (OS X only): https://github.com/indutny/latetyper
You can find the old versions here ^~^
Incredible @indutny
@matheuss just tested old versions, all of them seems to be faster than the latest iTerm2 :(
Good job HyperTerm, though!
Is there any way to reduce latency when typing things?
So it comes down to our measurement approach here. The approach. I chose here is "when can I see the letters after hitting a button on my keyboard". If we drop down into devtools and look at things per each frame we can get a better look at exactly when the new chars are shipped to the user.
^ We can see the majority of our frames are shipped to the user well under budget. Since the update loop for the screen is running inside of a requestAnimationFrame we are kinda self limiting how fast we are updating the screen (this is good, and bad in someways -- if we are trying to optimize for shipping the chars to screen as fast as possible)
I will be looking more into the costs associated with typing and some easy wins that we can get.
More on this later 鉁岋笍
Nice @samccone,
This might be relevant: http://www.html5rocks.com/en/tutorials/speed/unnecessary-paints/
I've noticed some "perceived" latency when using the backspace key鈥攖hat is, when typing, it seems pretty performant. When using backspace/delete, I've noticed that there's a small time difference between when the character goes away and when the cursor moves to the previous position. I don't know if this is what @indutny was talking about (it may have been typoing in both directions). If so, we can probably do some work to move the cursor faster to where it should be.
goes away and when the cursor moves to the previous position
This is due to how hterm implements the cursor update :)
https://github.com/dbkaplun/hterm-umdjs/blob/master/dist/index.js#L13004-L13013
I would say this is WAI :)
Interesting...thanks @samccone. Probably some room for improvement there :smile:
I'm seeing the behavior described by @mike-engel as well. I frankly can't tell the latency difference between iterm and hyperterm, but that deletion latency is really visible.
@chenglou do you observe "latency" in the char being deleted or the cursor moving?
The cursor moving. Also somewhat visible during insertion.
Here's a slowed down recording of what I'm seeing:
This is due to how hterm implements the cursor update :)
https://github.com/dbkaplun/hterm-umdjs/blob/master/dist/index.js#L13004-L13013
^ 馃槃 -- this could be fixed upstream
I can confirm seeing the delay between character input and cursor movement as well. Unfortunately it is enough to make typing in HyperTerm an uncomfortable experience.
EDIT: Things seems to have changed for the better in builds of latest master, perhaps as a side-effect of another update since there was no mention here. The delay is far less pronounced and the improvement clearly visible on a slowed down recording.
I'm not sure if this belongs here or if I should open another issue, but:
If I am using render heavy commandline apps, e.g. midnight commander. I can recognize a very heavy latency of half a second with every input. This make it unusable.
You can reproduce this with installing midnight commander and just try to navigate with the arrow keys.
@reicheltp can you record a timeline please right click and save and then share a link to it on https://chromedevtools.github.io/timeline-viewer/
thanks
@reicheltp very interesting! I'd love to reproduce it as well. Can you tell me exactly what programs you open and in what order?
@samccone Here a short timeline:
https://chromedevtools.github.io/timeline-viewer/?loadTimelineFromURL=https://gist.github.com/reicheltp/0bd72cbe69575b43073c7b02320b4bc0/raw
The first long frame is, when I opened the midnight commander with mc
, Second and third are a simple tab
to switch columns. And fifth and sixth are page-up
and page-down
. As you can see, the frames are really long.
@rauchg I have used Midnight Commander for Windows (Get it here https://sourceforge.net/projects/mcwin32/) or the OSX/Linux version here (https://www.midnight-commander.org/)
My Setup is Windows 10 Enterprise x64 with latest Hyper.app. Tried with powershell and cmd.
@reicheltp is it still a valid issue? Can you reproduce with v1.3.1?
@chabou Although I can notice a slightly performance improvement with v1.3.1, the issue still exists.
I've just installed Hyper a while ago, and while I don't have any concrete data to back this up, I can definitely _feel_ the typing delay.
Without plugin? What OS/Hardware? @simoncpu I can't feel it on my Macbook Pro 2017 running High Sierra, but that could be that my computer is overpowered 馃憤
@albinekb Yes, without plugin. OS is Windows 10 Pro, hardware is Thinkpad P51. I currently settled for wsltty because Bash on Windows works out of the box (I previously used ConEmu, but had problems with the colors).
BTW, I've just tried Hyper right now (normal command prompt, not bash), and there's a few milliseconds of delay between pressing the keyboard and displaying the characters on the screen. It's not a deal breaker, and I think most people won't notice it, but the experience is akin to typing commands in an SSH session.
Thanks for that @simoncpu, we're currently working on replacing the terminal rendering lib to xterm.js, which will give better results. After that there's lots more we can optimize to make it faster! 馃帀
I think I can feel (sorry, no hard data, just gut feel hehe) less lag when I right clicked on the Hyper icon and chose:
Run with graphic processor > Integrated graphics
The default is "High performance NVIDIA processor", although I think I recall having less lag when I used Hyper without an external monitor using the default settings a while ago. Electron issue with NVIDIA, maybe?
Hi,
In my system the issue happens when I'm using hyperline#0.6.1
...
As soon as I disable it in .hyper.js
and restart the app, the latency vanishes
Hi all,
I had experienced lags and high CPU usage on Windows 10 as well and it was resolved by adding %APPDATA%/hyper
folder as an exclusion to all of my installed antivirus (Windows Defender and Malwarebytes in my case).
I believe this happens because Hyper is built on Electron and the current AV solutions thinks as a "browser".
I have tried what was posted above.. this never happened until I updated to 2.0. Does anyone else have some ideas as to what causes this latency? I don't wanna use cmd.
@AustinTruex68 are you on Windows?
This issue is quite outdated.
Maybe you have same problem than https://github.com/zeit/hyper/issues/2838?
If not please open a new issue with all needed information to reproduce
@chabou, sorry about that. Yes it is the same issue as #2838
@freebroccolo Can you elaborate more on the zsh issue? I am experiencing latency as well and want to figure it out.
I'm on windows and I was also having a lot of latency issues with it. I was using with Gitbash (MINGW64) and if I opened up a new window and used cd, mkdir, ls etc. it was totally fine. However when I opened up node apps using inquirer, cl-table, etc. It would be so bad that scrolling would be impossible and there would be a 1 second lag typing in the prompts.
I'm really sad because I had a theme that matched my vscode which I really liked. Oh well.
Most helpful comment
Just wrote a small C application to measure latency. Turns out HyperTerm is actually faster than iTerm2. My bad!
Still would be cool if anyone else would be able to confirm it independently. I am not absolutely sure that my tool is correct.
(The tool is here)