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

perf: only process visible lines #135

Merged
merged 3 commits into from
Aug 8, 2024

Conversation

luckasRanarison
Copy link
Contributor

@luckasRanarison luckasRanarison commented Aug 8, 2024

Highlighting is done on each draw and it can be expensive on large logs. Highlights can't be cached because we can't store borrowed data, so instead I propose highlighting only visible lines.
We should also consider limiting the buffer size.

Edit: This could be improved even further by not relying on the scroll function from Paragraph and getting the lines directly, but I'm still trying to figure that out. (Fixed)

@luckasRanarison luckasRanarison changed the title perf: only highlight visible lines perf: only process visible lines Aug 8, 2024
@luckasRanarison
Copy link
Contributor Author

I have updated the PR to skip other lines by manually implementing scrolling, so that only visible lines are processed.

Synchronize line offsets when switching layout mode.
Copy link
Owner

@zifeo zifeo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work!

src/actors/console.rs Show resolved Hide resolved
@luckasRanarison
Copy link
Contributor Author

luckasRanarison commented Aug 8, 2024

Everything should be ok now, ready for review.

src/actors/console.rs Show resolved Hide resolved
@zifeo zifeo merged commit 6ff2691 into zifeo:main Aug 8, 2024
5 checks passed
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

Successfully merging this pull request may close these issues.

4 participants