Open vyfor opened 1 week ago
Thanks for pointing this out.
https://ratatui.rs/faq/#should-i-use-stdout-or-stderr has some of this, but there should be something in the concepts section
That specific guide is much too opinionated for my liking, without showing why you'd choose certain things, and why not. It's the wrong amount of code that will tend to cause the sorts of problems you faced...
Oh hmm, I overlooked the FAQ and blindly assumed both streams were equivalent, which back fired. Regardless, a notice or link to the relevant FAQ section could help clarify this for newcomers.
Problem
I've been trying to make a TUI app using Ratatui for the past few days, but at some point, I started experiencing slow UI renders, as shown below:
https://github.com/ratatui-org/ratatui/assets/92883017/4dee6113-0e9f-4a20-b755-841317dbe471
Upon investigating further, I noticed that when I was following this guide, I replaced
stdout
withstderr
. Sincestderr
seems to be unbuffered in most cases, it can cause performance issues.Solution
I'd either inform the user that using
stderr
on some terminals may cause performance issues, or switch to usingstdout
altogether. It took me quite some time to trace back the issue, so this is something worth reconsidering.