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

Lag with large horizontal line #9

Open
AlekseyPanas opened this issue Apr 2, 2023 · 2 comments · May be fixed by #28
Open

Lag with large horizontal line #9

AlekseyPanas opened this issue Apr 2, 2023 · 2 comments · May be fixed by #28
Labels
performance Editor or assembler performance related issues.

Comments

@AlekseyPanas
Copy link

AlekseyPanas commented Apr 2, 2023

I used a script to generate a bitmap and pasted the line into Saturn, which was about 46000. When you are scrolled far from the line, it doesn't render so everything is fine. When you get close to the line and it is rendered, the editor gets noticeably slower. It's still completely usable, but a few more of those lines and it might really start choking up.

Consider optimizing it so that very long lines aren't fully rendered if they are off screen.

Edit: Can confirm that I made Saturn cry. Another long line and it became very very slow

@1whatleytay
Copy link
Owner

1whatleytay commented Apr 3, 2023

Yep. Virtualization is done vertically but not done horizontally. Horizontal virtualization is much more challenging because not all characters are the same length (tabs are longer than spaces, etc.) so it's difficult to tell mathematically what the user can see (might be able to be done with some kind of binary search, but these are significantly more expensive to do).

You'll also notice as a consequence of vertical virtualization that you can only scroll left/right when you have long lines in proximity (this doesn't affect usability too much so I ended up leaving it in).

I recommend splitting your lines in the bitmap generator you use if possible! There are many other things in Saturn that deal with lines as units (lexing/syntax highlighting, undo/redo) and long lines can impact performance in other ways too.
Screenshot 2023-04-03 at 12 03 11 PM

Additionally, if you know some Javascript and HTML and you're interested in tinkering with the project, we welcome pull requests (for anything)! I'm trying to work on as much as I can, but I'm only one person and it's tough to get to everything.

@1whatleytay 1whatleytay added the performance Editor or assembler performance related issues. label Apr 3, 2023
@AlekseyPanas
Copy link
Author

Oh I didn't know you could split lines like that. Thanks!

I actually did want to contribute to this project! I have it on my backlog to try to implement collapsable blocks.

@milomg milomg linked a pull request Apr 7, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Editor or assembler performance related issues.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants