Skip to content
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

Mouse selection (& scroll) is extremely sluggish and I don't know why #179

Open
fooryo opened this issue Oct 29, 2024 · 13 comments
Open

Mouse selection (& scroll) is extremely sluggish and I don't know why #179

fooryo opened this issue Oct 29, 2024 · 13 comments

Comments

@fooryo
Copy link

fooryo commented Oct 29, 2024

What is the bug?
Mouse selection (& scroll) is extremely sluggish

What did you do to get the bug?
I was selecting some text from 170 lines docker compose file where half of it is made of commented lines.
ox 0.6.9 on Archilinux

What behaviour were you expecting?
At least good as in other text editor (micro)

@curlpipe
Copy link
Owner

curlpipe commented Oct 29, 2024

Try adjusting scroll amount in your configuration file (~/.oxrc)

I like to use

terminal.scroll_amount = 4

in mine

This will shift up/down by 4 lines at a time.

I should probably update the default (currently 2) to a higher amount because you're right, I find it too sluggish too.

@fooryo
Copy link
Author

fooryo commented Oct 29, 2024

Still sluggish for the mouse selection function.

About the scroll: yea, that will hide a bit the slugginess, still not so smooth, I need to say.

Try adjusting scroll amount in your configuration file (~/.oxrc)

I like to use

terminal.scroll_amount = 4

in mine

This will shift up/down by 4 lines at a time.

I should probably update the default (currently 2) to a higher amount because you're right, I find it too sluggish too.

@curlpipe
Copy link
Owner

curlpipe commented Oct 29, 2024

I have noticed that when selecting downwards past the viewport (i.e. moving the cursor down to the bottom of the editor to try to select text that is out of view) is a bit sluggish.

Is this what you are referring to?

Or are you referring to the skipping of multiple lines at once as not smooth enough?

Perhaps both?

@curlpipe
Copy link
Owner

curlpipe commented Oct 30, 2024

So I've performed a thorough investigation into Ox's performance and found the rendering process to be really slow - I just tried a simple optimisation and found the editor renders in the terminal ~3x faster than before, so I really hope this helps make it feel less sluggish. (It's due to be released in 0.6.10)

I'm also going to set the default scroll amount to 4 in 0.6.10.

@fooryo
Copy link
Author

fooryo commented Oct 30, 2024

Is this what you are referring to?

Bottom-up, top-down, inside or outside the viewport: doesn't makes any differences.

Or are you referring to the skipping of multiple lines at once as not smooth enough?

Not clear to me what you are referring to.

Perhaps both?

I'm referring to select region of text with the use of the mouse. I could make a screen recording of it if you can point me some light weight tool for windows (or linux/wayland) ( I'm using ox over ssh over Windows Terminal, but it is sluggish also on the terminal emulator on the real machine )

I just tried a simple optimisation and found the editor renders in the terminal ~3x faster than before

NICE, looking forward to try it


Thinking of it I might use OBS, I'll post a small video if I will able to do it

@curlpipe
Copy link
Owner

curlpipe commented Nov 2, 2024

0.6.10 released (this might make scrolling smoother?)

@fooryo
Copy link
Author

fooryo commented Nov 3, 2024

I'm sorry, man. It is basically the same as before. Look at the CPU usage while selecting, using a full core. I've tried both remotely (LAN) and locally, same behaviour except for one thing: while using ox remotely (windows terminal) the text changes color but I think it is a problem of mine and not ox's.

I'm not a good programmer and I cannot think of myself writing a text editor but I feel like there is something intrinsically wrong in this implementation of text selection. As I said before: other text editors (vim, nano, micro) do not have such a weird problem.

Am I the only one to have this problem?

ox.mp4

@curlpipe
Copy link
Owner

curlpipe commented Nov 4, 2024

Thanks for sharing this. May I ask which terminal emulator you are using and how you installed Ox?

@fooryo
Copy link
Author

fooryo commented Nov 4, 2024

Thanks for sharing this. May I ask which terminal emulator you are using and how you installed Ox?

Installed on Archlinux via AUR (paru), the package is ox-bin.
The system is Archlinux with hyprland and foot terminal.
What are you watching on that video is two Windows Terminal that ssh'd into the archlinux machine, one pane with ox and the other pane with htop, both processes of the archlinux machine, but as I said before the same behaviour can be seen on foot terminal (so locally)

@curlpipe
Copy link
Owner

curlpipe commented Nov 7, 2024

I greatly optimised the front-end with 0.6.10, so maybe the continued performance issues is because of inefficiencies in the back-end. I've already found some inefficiencies that I'm working on patching 👍

@curlpipe
Copy link
Owner

I've done some optimisations in 0.7.1 - not sure how much impact they will have - but I've tried targeting a few areas of blatant inefficiency so hopefully there should be at least some improvement.

@fooryo
Copy link
Author

fooryo commented Nov 17, 2024

Cool! Indeed, the optimizations worked.
Less sluggish by a ton in "native" (meaning: not thru ssh into the machine).
CPU usage doing crazy mouse selection as the video I posted before is now not more than 62%, still VIM uses not more 14%.
Using ssh into the machine (local network), the crazy mouse selection still lag behind.
Still, very good improvement known that ox is brand new project

@curlpipe
Copy link
Owner

That's great news! I'll keep looking at ways to optimise and hopefully, we can get Ox over SSH running more efficiently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants