node-pty icon indicating copy to clipboard operation
node-pty copied to clipboard

Delay between stdout output and data event fired

Open justablob opened this issue 3 years ago • 1 comments

Environment details

  • OS: Xubuntu
  • OS version: 21.10
  • node-pty version: 0.10.1

Issue description

It seems like sometimes, there is a delay between the child writing to stdout and IPty.onData being fired. For reference: I observed this behavior while writing a libinput gestures client for Linux. Opening libinput debug-events in a normal terminal gave me immediate stdout output, while sometimes, the output from node-pty is lagging behind a few hundred milliseconds. It is miles better than child_process buffering, but still leads to noticeable delays.

justablob avatar Feb 19 '22 13:02 justablob

I haven't observed this, I don't use Linux much these days though. Next steps here would be to try launching the node process in question with --inspect, connecting chromium and getting a performance profile to see if there was something else blocking the main thread:

image

Tyriar avatar Feb 22 '22 15:02 Tyriar

I upgraded the node-pty version I was using a month or two ago and there was a noticeable improvement in latency for plain interactive use.

sedwards2009 avatar Dec 27 '22 15:12 sedwards2009