Skip to content

Improve search performance#68

Merged
dstillman merged 2 commits into
zotero:masterfrom
windingwind:fix-slow-search
Jan 13, 2026
Merged

Improve search performance#68
dstillman merged 2 commits into
zotero:masterfrom
windingwind:fix-slow-search

Conversation

@windingwind
Copy link
Copy Markdown
Contributor

@windingwind windingwind commented Dec 5, 2025

Use debounce for searching
Only render decorations within view range
Other minor fixes for efficiency

For note with 100k words, before fix it hangs for over 1 minute for searching a single char t, now stably <100ms. Test on MacOS with M2pro

Can test with the book DRACULA: https://gutenberg.org/files/345/345-h/345-h.htm (create note - select all on website - copy - paste - search - type t)

@windingwind
Copy link
Copy Markdown
Contributor Author

try to notify @mrtcode so that we don't forget this fix, as people are distributing their own fix to this with their modified version of my plugin, which is not very ideal...

@mrtcode
Copy link
Copy Markdown
Member

mrtcode commented Dec 20, 2025

This is a great improvement to the search performance! Just need to figure out why the scroll listener doesn't update the decorations, and the yellow highlights appear only if clicked on the text.

Use debounce for searching
Only render decorations within view range
@windingwind
Copy link
Copy Markdown
Contributor Author

Thanks! Should be fixed now.

@windingwind
Copy link
Copy Markdown
Contributor Author

Screen.Recording.2026-01-12.at.15.00.02.mp4

@dstillman dstillman merged commit c5fbfd9 into zotero:master Jan 13, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants