MiloszKrajewski / TooMany

Docker inspired console application host for Windows
MIT License
6 stars 1 forks source link

Monitor terminal performance issues #33

Closed jonathonhawkins92 closed 3 years ago

jonathonhawkins92 commented 3 years ago

Currently the app will use about 30% of my CPU when displaying a buffer of around 500 logs in prod and 300 in dev, to mitigate this issue we seek to implement windowing.

Ref: https://reactjs.org/docs/optimizing-performance.html#virtualize-long-lists https://addyosmani.com/blog/react-window/

jonathonhawkins92 commented 3 years ago

I gave windowing a shot but found that our issues isn't just how much data there is but how much constantly changing data there is, so this ended up not being as much of a silver bullet as I had hoped.

Since this wasn't successful I opted to poke around VSCodes code base to see what they were doing to get their integrated terminal to work, this is where I found xterm js, an ingenious yet fiddling package that renders the text out to a canvas, this has been successful and will be the way forward.

Note, this approach has increase the project complexity slightly, and I'm sure my implementation leaves something to be desired, so expect bugs/hot fixes in this area.