Skip to content

Improve ui performances#43

Merged
RegenJacob merged 3 commits intoRegenJacob:mainfrom
Azkellas:perfs
Feb 3, 2026
Merged

Improve ui performances#43
RegenJacob merged 3 commits intoRegenJacob:mainfrom
Azkellas:perfs

Conversation

@Azkellas
Copy link
Contributor

This PR improves the performances of the ui, as it takes a couple milliseconds with hundreds of logs.

Three things were implemented:

  • Use egui::ScrollArea::show_rows to only add label for visible records

This is not very useful alone, as it needs to know the n to n+k records to display.
To know this we currently need to compute the LayoutJob and filter by search on it.

  • Cache the search results

So to make full use of it we cache the search results.

These two combined provide a 15x speedup improvement at low cost (only ony bool per record).

  • Bonus: cache the layout jobs

This is more memory intensive and thus is an option in the Ui now (enabled by default), but this brings another 30% improvement.

A benchmark example was added to the project to compare. On my computer with the benchmark, the curent release version with cache layout enabled runs in 2.100ms, while this PR runs in 0.100ms.

release

1000 logs regex search
baseline 2.100ms 1.900ms
cache search results 0.140ms 0.120ms
cache layout jobs 0.100ms 0.100ms

debug

1000 logs regex search
baseline 12.200ms 7.000ms
cache search results 0.760ms 0.750ms
cache layout jobs 0.700ms 0.650ms

@RegenJacob
Copy link
Owner

Wow! This looks very impressive!

I'm unsure how much time I have this week so I might need a bit before Merging.

@RegenJacob RegenJacob merged commit 27157bf into RegenJacob:main Feb 3, 2026
3 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.

2 participants