Skip to content

add an index to significantly speed up get_fresh_msg_cnt() - #1881

Merged
r10s merged 2 commits into
masterfrom
fix-bottleneck
Sep 2, 2020
Merged

r10s merged 2 commits into
masterfrom
fix-bottleneck

Conversation

@r10s

@r10s r10s commented Sep 2, 2020

Copy link
Copy Markdown
Contributor

thanks a lot to @csb0730 for endless trying to figure out a database bottleneck - where i was not even totally convinced that it even exist!

i tested the change on my 2yo motog and iphone7 with a database of 50k messages - and even here, saving was significant, see comments in the sourcecode. i added the comment also to ensure, we do not run into this issue again on changes.

fixes #1879

@adbenitez adbenitez left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

besides my suggestion, it looks good to me

Comment thread src/chat.rs Resolved
@link2xt

link2xt commented Sep 2, 2020

Copy link
Copy Markdown
Collaborator

Is it possible to add a benchmark that can be run with nightly?
Benchmarks are documented here: https://doc.rust-lang.org/unstable-book/library-features/test.html

Co-authored-by: Asiel Díaz Benítez <[email protected]>
@r10s

r10s commented Sep 2, 2020

Copy link
Copy Markdown
Contributor Author

Is it possible to add a benchmark that can be run with nightly?

i've played around a bit, however, i did not get a good way to reproduce that on my machine yet. however, i create a subsequent pr with that.

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.

slow get_fresh_msg_cnt() as reason for chatlist scrolling slowness

3 participants