Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Node is freezing #15

Open
henryruhs opened this issue Jan 11, 2018 · 8 comments
Open

Node is freezing #15

henryruhs opened this issue Jan 11, 2018 · 8 comments
Labels

Comments

@henryruhs
Copy link

henryruhs commented Jan 11, 2018

Hello,

svg-term works perfect on my machine with the given 113643 example cast.

There seems to be an issue with new formats. I had to download my new cast in the version 1 syntax as svg-term told me that only version 1 and version 2 syntax are supported.

Watch cast: https://asciinema.org/a/znqFxSzM9CmIJINrmn2IzPX5g
Download JSON: https://asciinema.org/a/znqFxSzM9CmIJINrmn2IzPX5g.cast?dl=true

Setup

svg-term: 2.0.3
NodeJS: 8.7.0
NPM: 5.6.0
OS: Ubuntu 17.04

Command

svg-term --in 156579.json --out 156579.svg
svg-term --cast znqFxSzM9CmIJINrmn2IzPX5g --out 156579.svg

Issue

The terminal and sometimes my whole machine is freezing - there is no way to cancle it using CTRL+C. No output is being processed.

@marionebl marionebl added the bug label Jan 11, 2018
@marionebl
Copy link
Owner

Thanks for reporting, I'll investigate this over the next days

@marionebl
Copy link
Owner

marionebl commented Jan 11, 2018

Did the first steps to debug this, seems like load-asciicast enters an infinite loop for your asciicast. Will investigate further...

@henryruhs
Copy link
Author

Great, it felt like a infinite loop :-) Looking forward to a fix, thank you man.

@marionebl
Copy link
Owner

Did a quick dirty test setup in svg-term

// svg-term/index.tsx#L81
console.log('load');
const cast = load(json, options.width, typeof options.height === 'number' ? options.height + 1 : undefined);
console.log('load', process.hrtime(start));

logs load and then freezes the process.

@bunopus
Copy link

bunopus commented Jan 13, 2018

Looks like it happens with the all new casts :-(

UPD: it's not true, not all casts affected

@marionebl
Copy link
Owner

@bunopus That’s not what I experience in daily usage. Could you provide the version of your asciinema cli and links to affected uploaded casts?

@bunopus
Copy link

bunopus commented Jan 13, 2018

@marionebl it's very strange

asciinema --version
asciinema 1.4.0

I have two casts with almost the same content, but one is working, second - not.
https://asciinema.org/a/eUnQPgWgKFVl4WUqinKbX7Qze - not working, svg-term-cli freezes
https://asciinema.org/a/D3qhyP1ORhqwL3yllRnnzHIbN - almost the same content - working

🤔

@marionebl
Copy link
Owner

marionebl commented Jan 13, 2018

Spent some more time on this. load-asciicast indeed does not enter an infinite loop, it just gets very very slow for certain casts:

cast width height size render time
156787 208 58 29K 145s
156838 112 32 28K 13s
156579 155 43 59K > 300s

What jumped at me is the big dimensions. Forcing down the screen buffer size leads to notable speed increases:

cast width height size render time
156787 80 25 29K 5s
156838 80 25 28K 5s
156579 80 25 59K 11s

I'll create an issue with asciinema about this. For the time being you can force the screen buffer down via svg-term-cli:

svg-term --cast eUnQPgWgKFVl4WUqinKbX7Qze --out 156787.svg --width=80 --height=25
svg-term --cast znqFxSzM9CmIJINrmn2IzPX5g --out 156579.svg --width=120 --height=25

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants