Skip to content

Allow refresh to execute 30 times a second maximum#128

Merged
parisk merged 1 commit intoxtermjs:masterfrom
Tyriar:127_debounce_refresh
Jun 14, 2016
Merged

Allow refresh to execute 30 times a second maximum#128
parisk merged 1 commit intoxtermjs:masterfrom
Tyriar:127_debounce_refresh

Conversation

@Tyriar
Copy link
Copy Markdown
Member

@Tyriar Tyriar commented Jun 13, 2016

For commands that pass a significant amount of output to the write function,
this prevents the terminal maxing out the CPU and making the UI unresponsive.
While commands can still run beyond what they do on the terminal, it is far
better with a debounce in place as every single terminal manipulation does not
need to be constructed in the DOM.

A side-effect of this is that it makes ^C to interrupt a process seem more
responsive.

Fixes #127
Fixes #126

For commands that pass a significant amount of output to the write function,
this prevents the terminal maxing out the CPU and making the UI unresponsive.
While commands can still run beyond what they do on the terminal, it is far
better with a debounce in place as every single terminal manipulation does not
need to be constructed in the DOM.

A side-effect of this is that it makes ^C to interrupt a process seem more
responsive.

Fixes xtermjs#127
Fixes xtermjs#126
@parisk
Copy link
Copy Markdown
Contributor

parisk commented Jun 14, 2016

LGTM. Thanks a lot!

@parisk parisk merged commit e37a9b6 into xtermjs:master Jun 14, 2016
@parisk
Copy link
Copy Markdown
Contributor

parisk commented Jun 14, 2016

@Tyriar I think that there might be a chance that this PR made the focus/blur events go a little bit crazy. Could you please try setting a listener to each event and compare the event emission rate before and after the attached commit?

It seems that debounceRefresh runs perpetually and not only when requested. Ref: https://github.com/sourcelair/xterm.js/pull/128/files#diff-d4f745d6f29faa0617f2e02bb95f0c44R310

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants