-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix piping to Helix on macOS #5468
Conversation
Waiting on a crossterm release with the meged PR. |
What are the performance implications here? I figured the mio one is probably better optimized |
Fwiw, I haven't noticed any performance differences in Helix or other projects using crossterm when testing manually. I did mean to do a comparative benchmark for the crossterm PR, but gave up since I couldn't figure out how to do that without emulating the controlling terminal. If there are any existing benchmarks for helix, or if you know of a similar suite in another project, I could try to run it and report what I find. |
A flame graph before/after the change would be useful. As a really simple test you could try opening a 10MB text file and scrolling from top to bottom. Measuring the flame graph there + time taken would be at least one data point |
What is left to merge this PR? The test you mentioned @archseer ? |
Actually crossterm does look like its taking up a bit more space in that flamegraph although not by a huge amount. Probably doesn't matter much in practice. Couldn't we just turn this feature on for macos and keep it off for other platforms? Platform specific feature are possible with cargo I think. On macos the extra functionality is definitly worth whatever small performance regression this might cause and on other platforms nothing would change then |
The one by this PR actually looks shorter though? There's some mentions about enabling this feature and dropping |
@the-mikedavis sorry I couldn't get to this so far, thank you for taking the time. Please see crossterm-rs/crossterm#755 - I think we should hold off on this pr until it is fixed (I'm working on it). |
Looks like there's a new crossterm 0.26.1 release with your fix 🚀 https://github.com/crossterm-rs/crossterm/releases/tag/0.26.1 |
Hmm yeah I saw the same difference but switched the two plots up by accident. This seems very surprising to me tough. |
That was a macOS laptop. I'll take some linux ones too for comparison. Ok here's Linux on 1a87d14 scrolling through Moby Dick by holding C-f (trackpad scrolling is working differently between macOS and Linux so I recorded all of these by holding C-f instead): Linux on this PR: MacOS on 1a87d14: MacOS on this PR: |
Thanks for the benchmarks! Interesting how different linux and mac are. Is it possible you switched the flamegraphs up in your earlier comment? It looks like this PR is a slight performance regression on both macos on linux from the new flamegraphs you posted. The new macos benchmarks look similar to your earlier benchmark but swapped and now looks roughly what I would have gussed. It doesn't seem like crossterm will switch away from mio immedietly, the followup PR (crossterm-rs/crossterm#743) still has everything behind a flag (and doesn't drop mio from the dependencies either). I think for now keeping it behind a cfg would make sense as its a performance regression and needs one extra dependency. It doesn't matter much either way tough. |
Ah yeah, they weren't recorded very scientifically either, just swipe scrolling 😅. I don't have the original files around so I can't be sure |
I'm running into this crash on a Mac with crossterm 0.26.1 (so with @yyogo 's crossterm patch). How do I properly configure my build of helix to use tty? Right now I'm crashing trying to use |
this PR wasn't merged yet. Crossterm doesn't use dev-tty unless you explicitly set a feature flag |
(Pushed a merge commit since I made a bunch of conflicts in #4939 😅) |
@the-mikedavis as you pointed out crossterm 0.26.1 was released a few months ago with the crash fix. What are the remaining decision criteria for switching to the |
We could also enable the feature only on macos, I would think the usability improvement is worth the slight performance regression. |
This fixes piping to Helix on macos. Also remove the error message preventing this usage.
|
Crossterm will soon merge crossterm-rs/crossterm#735 which will let it use /dev/tty on macOS. This will fix #2111 and allow piping to Helix on macOS.
Fixes #6734