Skip to content
This repository was archived by the owner on Nov 4, 2026. It is now read-only.
This repository was archived by the owner on Nov 4, 2026. It is now read-only.

Slow for big logs #687

Closed
Closed

Description

@fabianschwarzfritz

Problem
I am using hyperterm together with SSH and tmux in version 0.7.1 (0.7.1.36) . When using cat or docker logs <xyz>, hypterterm is extremely slow and then completely hangs. Hypterterm is then unusable.

As I can still attach to the existing tmux session with OSX's terminal or iterm2, I know for sure that the tmux session is okay. Hypterterm seems to have problems rendering large output files.

Can anyone else reproduce this or is this just me having this issue?

Some data:
Hyperterm version: 0.7.1 (0.7.1.36)
OSX version: 10.11.2 (15C50)

Activity

  1. added
    📊 Type: Performance
    on Sep 2, 2016
  2. dennisroethig commented on Sep 3, 2016

    @dennisroethig

    Can confirm ... using docker logs on a bigger rails app running migrations hangs HyperTerm completely for me. No issues with the native MacOSX terminal though.

  3. MrRio commented on Sep 3, 2016

    @MrRio
    Contributor

    We may need to fork hterm and add some kind of buffering/caching

  4. added
    help wanted
    on Sep 3, 2016
  5. ppot commented on Sep 3, 2016

    @ppot
    Contributor

    @MrRio That would be a good idea. Mostly all my PR are for patching hterm lacking functionnality.

  6. queso commented on Sep 8, 2016

    @queso

    I also get this hang issue when I push a lot of text at hyperterm. I use tmux and the underlying tmux session seems fine, I can open iTerm and connect just fine and everything still works. I just can't seem to type and get a response via hyperterm once it seems to lock up.

  7. hachre commented on Sep 22, 2016

    @hachre

    Same thing happens without tmux, just by displaying a file with very long content via cat. I noticed that memory usage goes towards my machine's maximum when the heavy slowdowns start (so that's probably why).

    Related issue #571

  8. webbm commented on Dec 13, 2016

    @webbm

    For macOS, looking at Terminal and iTerm, there is a notion of a scrollback buffer where you can limit the number of lines to which you can scroll back to view. Performance would likely increase if it only had to render the most-recent n lines rather than all of the lines.

  9. KarlAmort commented on Dec 20, 2016

    @KarlAmort

    I did a little test and ran both Hyper and Terminal.app with long outputs, mostly to test if it's the number of lines, rows, total characters that slow Hyper down, as welll as test different characters (i thought it may be parsing the output for highlighting or similar).

    Results seem to indicate that it's mostly a function of total # of characters. But I'm pretty sure there's something fundamentally wrong, as i now have a Helper process using 15GB of RAM.

    The times are surprisingly close to a linear relationship. Digging through a profile with Instruments didn't get me to anything specific, but it appeared as if there was an awful lot of of notification subscribing- and calling going on. I bet a strategically placed debounce would improve performance dramatically.

    Also: Emojis count for 10 characters.

    Lines Char Char/Line Total Chars Time (sec) Terminal Time (sec) Hyper CPU Hyper
    1 . 1 1 1.42 1.20
    1 . 10 10 1.41 1.19
    1 . 100 100 1.42 1.20
    1 . 1000 1000 1.42 1.20
    1 . 10000 10000 1.41 1.20
    10 . 1 10 1.41 1.20
    10 . 10 100 1.42 1.20
    10 . 100 1000 1.41 1.20
    10 . 1000 10000 1.41 1.20
    10 . 10000 100000 1.41 1.20
    100 . 1 100 1.41 1.20
    100 . 10 1000 1.41 1.20
    100 . 100 10000 1.41 1.20
    100 . 1000 100000 1.42 4.42 17
    100 . 10000 1000000 1.41 4.40 47
    1000 . 1 1000 1.41 1.20
    1000 . 10 10000 1.41 1.21
    1000 . 100 100000 1.42 1.20
    1000 . 1000 1000000 1.42 4.40 47
    1000 . 10000 10000000 1.42 20.45 79
    10000 . 1 10000 1.41 1.20
    10000 . 10 100000 1.41 4.41 13
    10000 . 100 1000000 1.41 4.41 47
    10000 . 1000 10000000 1.41 20.44 80
    10000 . 10000 100000000 1.42 196.92 91
    1 { 1 1 1.41 1.19
    1 { 10 10 1.41 1.19
    1 { 100 100 1.41 1.20
    1 { 1000 1000 1.42 1.19
    1 { 10000 10000 1.41 1.20
    10 { 1 10 1.41 1.19
    10 { 10 100 1.41 1.19
    10 { 100 1000 1.41 1.20
    10 { 1000 10000 1.42 1.19
    10 { 10000 100000 1.42 1.19
    100 { 1 100 1.42 1.19
    100 { 10 1000 1.41 1.19
    100 { 100 10000 1.42 1.19
    100 { 1000 100000 1.42 1.20
    100 { 10000 1000000 1.41 4.39 46
    1000 { 1 1000 1.41 1.20
    1000 { 10 10000 1.42 1.21
    1000 { 100 100000 1.42 1.21
    1000 { 1000 1000000 1.42 4.40 47
    1000 { 10000 10000000 1.41 20.45 79
    10000 { 1 10000 1.41 1.20
    10000 { 10 100000 1.43 1.20
    10000 { 100 1000000 1.42 4.40 46
    10000 { 1000 10000000 1.41 20.45 74
    10000 { 10000 100000000 1.41 193.56 92
    1 🍷 1 1 1.42 1.20
    1 🍷 10 10 1.41 1.19
    1 🍷 100 100 1.41 1.19
    1 🍷 1000 1000 1.42 1.19
    1 🍷 10000 10000 1.42 1.19
    10 🍷 1 10 1.41 1.20
    10 🍷 10 100 1.41 1.19
    10 🍷 100 1000 1.41 1.19
    10 🍷 1000 10000 1.41 1.20
    10 🍷 10000 100000 1.42 4.39 48
    100 🍷 1 100 1.41 1.20
    100 🍷 10 1000 1.41 1.19
    100 🍷 100 10000 1.42 1.19
    100 🍷 1000 100000 1.41 4.40 37
    100 🍷 10000 1000000 1.41 10.81 70
    1000 🍷 1 1000 1.41 1.20
    1000 🍷 10 10000 1.41 1.20
    1000 🍷 100 100000 1.41 4.41 48
    1000 🍷 1000 1000000 1.41 14.04 75
    1000 🍷 10000 10000000 1.41 136.29 90
    10000 🍷 1 10000 1.42 1.22
    10000 🍷 10 100000 1.42 4.44 32
    10000 🍷 100 1000000 1.42 14.12 74
    10000 🍷 1000 10000000 1.41 137.11 90
    10000 🍷 10000 100000000 1.43 1567.05 86

    Tagging #94, #555, #881 and #1169 as probably identical issues.

  10. rauchg commented on Dec 21, 2016

    @rauchg
    Member

    Thanks a lot @MatthiasWinkelmann. This will certainly allow us to improve. CCing @dotcypress

  11. KarlAmort commented on Jan 9, 2017

    @KarlAmort

    I've investigated this a bit further. Doing a cat bigfile.manylines.txt creates a stream of about 1,000 actions per second:

    screen shot 2017-01-09 at 18 10 46

    I'm pretty sure these should be buffered to <= 60FPS as early as possible, but definitely before they hit the renderer. The following is a CPU profile captured with the developer tools.

    screen shot 2017-01-09 at 20 21 56

    I tried to implement some sort of debouncing in https://github.com/zeit/hyper/blob/master/app/session.js#L56 but unfortunately couldn't get it to work reliably.

    Another possibly easy performance win may be to switch the latter two terms in https://github.com/zeit/hyper/blob/1b6d925524f30148ead6c46326a0d47964d120b5/lib/hterm.js#L158: The runes(text) takes 15 to 200 times as much time as the the regex in containsNonLatinCodepoints(text) in a short test I did (35650ms vs. 150ms for one very long line, 45ms vs. 3ms for 10000 iterations on a 20-char string). As can be seen in the CPU profile it represents about half of the CPU time of echoing text to the terminal.

    In a CPU profile I created with the MacOS Activity Monitor, I also saw a lot of activity related to memory allocation/garbage collecting, which is possibly caused by runes as well since it creates an array on each call. But I'm unsure if that's already included in the Chrome profile.

    Probable duplicates of this are #474 #1040, #1044, #571, #574 , #1237, #1221 as well the ones tagged two messages up, and possibly #1157 cc @dotcypress

  12. rauchg commented on Jan 9, 2017

    @rauchg
    Member

    Awesome work @MatthiasWinkelmann. I was just discussing with @nw that another performance win will be to bypass the Redux reducer (which creates a temporary Write object).

    Instead, we can emit as part of a side effect, and then subscribe from the Term directly (pub/sub) style

  13. rauchg commented on Jan 9, 2017

    @rauchg
    Member

    Also copying @hharnisc who was looking at the debouncing problem

  14. hharnisc commented on Jan 10, 2017

    @hharnisc
    Contributor

    Thanks for the heads up on this thread @rauchg, digging into some hterm source code this evening 🙇

  15. hharnisc commented on Jan 10, 2017

    @hharnisc
    Contributor

    I tried buffering in a couple different points in the write pipeline. But this iteration has been the most successful.

    // call at most ~60 times per second to avoid overloading renderer, queue if overloading
    const rateLimitedDispatch = rateLimit(store_.dispatch, 16);
    rpc.on('session data', ({uid, data}) => {
      rateLimitedDispatch(sessionActions.addSessionData(uid, data));
    });

    It's super simple, if the function isn't rate limited call it immediately otherwise queue up the function.

    I tested this with cat largefile.txt, and it didn't lock up the ui for me (current release did). It takes a bit for the text to stream out when buffering so I'm not sure if this is good enough. Still more that could be done in terms of optimization.

    @MatthiasWinkelmann would you be up for trying this again with this fork/branch?

    https://github.com/hharnisc/hyper/tree/buffer-session-data

  16. 21 remaining items

  17. ppot commented on Aug 15, 2017

    @ppot
    Contributor

    As being said. hterm give us much more trouble to make performance improvement since we can't always monkey patch his rendering problem. Using xterm will give us much more availability and flexibility as the same time as being maintained on a more suitable base.

    We do understand the need to have a better performance and we do take it seriously. And after the xterm switch. We will be able to do better performance improvement on the upcoming times.

  18. insanityfarm commented on Nov 2, 2017

    @insanityfarm

    Has there been any progress on this? I'm encountering this issue frequently and it's rather disruptive to my workflow. Looks like there hasn't been any motion in the xterm branch in about 2 months.

  19. philippbosch commented on Nov 2, 2017

    @philippbosch

    @insanityfarm I haven‘t run into this issue anymore with v2 which afaik uses xterm now.

  20. chabou commented on Nov 2, 2017

    @chabou
    Contributor

    @insanityfarm xterm has been merged into our v2 branch. And this branch was renamed canary. You don't have to build Hyper from source anymore, to use xterm. You only have to set canary in your config as update channel.

  21. insanityfarm commented on Nov 2, 2017

    @insanityfarm

    Thank you for the information! I wasn't up to speed on the canary branch. Just updated and ran a quick test, and (so far) the issue seems to be resolved. Appreciate your help.

  22. cesarferreira commented on Mar 4, 2018

    @cesarferreira

    Hi guys, this issue is still present in 1.4.8

  23. dennisroethig commented on Mar 4, 2018

    @dennisroethig

    @cesarferreira see #687 (comment) above - you should be able to switch to the canary version ... using it without major issue since a while

  24. cesarferreira commented on Mar 5, 2018

    @cesarferreira

    Thanks for the reply @dennisroethig , how do I change to the canary version? there is no reference to stable version or something similar in my config

  25. chabou commented on Mar 5, 2018

    @chabou
    Contributor
  26. danielkalen commented on Aug 28, 2018

    @danielkalen

    This is an ongoing issue even in v2.0-2.1...

  27. KarlAmort commented on Sep 1, 2018

    @KarlAmort

    @danielkalen I've just tested it with the current canary version, and the situation seems much improved.

    The test above, with 10000x1000x🍷, which previously took 137 seconds is now done in 15 seconds, a 10-fold increase in performance.

    iTerm does the same in 25 seconds, whereas Terminal.app is done almost instantly. So there's obvious room for improvement, but it's far less likely to actually interfere with work now.

    iTerm does, however, better handle interruptions (control+c): it quits instantly, while Hyper finishes the output before handling the interruption. But that's tracked in #555, #1121, and #1484

  28. danielkalen commented on Sep 1, 2018

    @danielkalen

    @MatthiasWinkelmann #2449 (comment)

    Take a look at the gif I posted comparing terminal
    And hyper. This was running on 2.1.0 canary

  29. fabianschwarzfritz commented on Jan 4, 2019

    @fabianschwarzfritz
    Author

    I opened this issue and it's still an ongoing issue for me. Am I right in the assumption that this is now tracked in #2449 ?

    I don't know why this was closed and is now tracked in another issue, but so be it.

  30. mabdelfattah commented on Jan 9, 2019

    @mabdelfattah

    I have the same problem with Docker log on latest canary
    image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wanted📊 Type: Performance

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions