Skip to content

Conversation

@sxyazi
Copy link
Owner

@sxyazi sxyazi commented Mar 29, 2024

Resolves an issue reported by @DreamMaoMao on Yazi's Discord server, https://discord.com/channels/1136203602898194542/1136203604076802092/1223142137860984943


This PR fixes a performance regression introduced by the latest main branch. Recently, Yazi switched from stdout to stderr, but since stderr is unbuffered (previously stdout was line-buffered, i.e. LineWriter), this change caused a decrease in rendering frame rate.

This PR adds a block buffer ( BufWriter) to stderr, while solving this performance regression, it theoretically can further improve performance - this is an example comparing LineWriter and BufWriter, https://github.com/orhun/rust-stdout-vs-stderr

stdout-vs-stderr-detailed

(Image source: https://github.com/orhun/rust-stdout-vs-stderr)

@sxyazi sxyazi merged commit 66d12da into main Mar 29, 2024
@sxyazi sxyazi deleted the pr-728f2658 branch March 29, 2024 07:40
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants