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

[Feature Request] Performance improvements #40

Open
tbung opened this issue Jan 19, 2022 · 3 comments · May be fixed by #43
Open

[Feature Request] Performance improvements #40

tbung opened this issue Jan 19, 2022 · 3 comments · May be fixed by #43
Labels
enhancement New feature or request

Comments

@tbung
Copy link
Contributor

tbung commented Jan 19, 2022

Is your feature request related to a problem? Please describe.
Having magma enabled makes scrolling slow, especially in larger cells and files.

Describe the solution you'd like
I didn't have time to look into it in more depth, but MagmaUpdateInterface should be made as performant as possible, maybe caching and only moving certain elements, or not be called on every curser move event. Doing slow computations asynchronous might also be possible.

Describe alternatives you've considered
Simply disable the autocmd.

Additional context
I'll probably be able to look into it a little at the end of next week.

@tbung tbung added the enhancement New feature or request label Jan 19, 2022
@tbung
Copy link
Contributor Author

tbung commented Jan 23, 2022

I have tested implementing some improvements. Checking if we are in cell we already highlighted before clearing the interface and rehighlighting does improve the performance massively as long as output is hidden. I'll work on cleaning that up and checking if the output should be redrawn or if it even is in the visible range next.

@dccsillag
Copy link
Owner

Great!

I remember this would be a slightly tricky thing in the code, so I had opted to do the simple thing first and then keep see what I needed to optimize. As it turned out, everything felt very snappy for me so I thought we were, surprisingly, actually fine with the naive implementation. How did you notice / how apparent are the performance issues?

@tbung
Copy link
Contributor Author

tbung commented Jan 24, 2022

test.mp4

To be fair, I am working with a software engineerical mess of a 2500 line script with a cell with 350 lines so this is probably an edge case. As you can see in the video, scrolling gets laggy and choppy, with it keeping on scrolling after releasing j/k. As I said, with hidden output this does not happen when we only rehighlight lines if the cell span changes. I'm currently a little busy but I'll open a draft pr at the end of the week.

@tbung tbung linked a pull request Jan 31, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants