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

test(list): Added benchmarks #377

Merged
merged 1 commit into from
Aug 11, 2023
Merged

Conversation

Valentin271
Copy link
Member

I added benchmarks for the list widget :

  • Render
  • Render half scrolled

Chose 16284 as the highest number of lines so we can see the three tests on the graph.

I tried benchmarking the new operation but I think it is not necessary as it only involves copying/moving.


Some benchmarks

Figure 1: Render time relative to number of lines
image
Figure 2: Halfway scrolled render time relative to number of lines
image
Figure 3: Render vs halfway scrolled render
image

The number of lines impact the performances (probably because of memory usage?) but where the list is rendered (the offset) doesn't seem to.


Relates to #137

@codecov
Copy link

codecov bot commented Aug 6, 2023

Codecov Report

Merging #377 (caccb42) into main (e18393d) will not change coverage.
Report is 4 commits behind head on main.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main     #377   +/-   ##
=======================================
  Coverage   84.99%   84.99%           
=======================================
  Files          40       40           
  Lines        8686     8686           
=======================================
  Hits         7383     7383           
  Misses       1303     1303           

see 1 file with indirect coverage changes

benches/list.rs Outdated Show resolved Hide resolved
benches/list.rs Show resolved Hide resolved
Added benchmarks for the list widget (render and render half scrolled)
Copy link
Member

@joshka joshka left a comment

Choose a reason for hiding this comment

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

LGTM - thanks again

Copy link
Collaborator

@kdheepak kdheepak left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! This is great.

@joshka joshka added this pull request to the merge queue Aug 11, 2023
Merged via the queue into ratatui-org:main with commit 664fb4c Aug 11, 2023
30 checks passed
@Valentin271 Valentin271 deleted the test/list-benches branch August 11, 2023 07:54
@joshka joshka added this to the v0.23.0 milestone Aug 21, 2023
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.

None yet

3 participants