-
Notifications
You must be signed in to change notification settings - Fork 113
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
nvpy freezing hard when typing intial characters in search on acct with over 1500 notes, makes searching very difficult. #233
Comments
Is it a Windows environment? Poor performance on Windows is a known issue. See #213. I am planning a fix in the next milestone. |
30 seconds!? On my Windows environment, I can use nvPY with 1500+ active notes. The response is slow but doesn't freeze for 30 seconds. Could you take a performance profile by following the steps below?
|
Thanks for responding! It's not a windows environment. Yes, it can be anywhere from 13-30 seconds per character 1 and <15 for character 2. Deleting characters under the 3 character range takes even more time for some reason. Here's the log:
|
The part of I am giving attention:
Tk operation proceeded 39k times, and the tag_add proceeded 20k times in 51 seconds. I suspect that text highlighting causes significant performance down. @wrathofthomas Are you displaying very long text with nvPY? Do you see a lot of highlights in the notes list when you type a few characters into the search box? |
Re displaying long text, I would say no. My notes aren't any longer probably than most people's |
Thanks for your reply.
No option provided to turn off highlighting. It needs to edit the source code. Just remove
|
In view.py of ~/.local/pipx/venvs/nvpy/lib/python3.11/site-packages/nvpy? Remove those three quoted sections? |
Yes, that's right. |
Yep that's it. It's immediately responsive now. How do we keep the highlighting feature, and avoid the delay? Maybe only highlight in body? |
I think that you should keep the highlight process in Lines 1816 to 1826 in 7fa6ab6
|
If i leave lines 1816-1826 in and delete the first to sections. The searching is still immediate with no delays but highlighting is kept in body. |
Nice :) |
So how to fix the highlighting in the list? |
The update process of the Notes List was the cause of nvPY slowdown. Adding highlighting to the Notes List made the performance problem worse. Plans to fix the root cause are listed in the |
ok! thanks! |
Your result:
My result:
|
Could it be the venv? |
Yes. nvPY runs inside a venv managed by pipx. Note that the |
Would you like me to try to install and run this outside the venv and send you another log? |
I cannot figure out how to do this. If you have any guidance let me know. Thanks! |
Are the Python loads the Tkinter module from the system global area? The Tkinter module is part of the Python Standard Library. So, it should not be affected by venv/pipx.
|
This is what I got.
Looks the same as yours |
The location that makes A quick check in my debian environment gave me harsh results. The reason is that libtk does not have debugging symbols and most lines were displayed with hexadecimal addresses. You may need to build libtk and libtcl with the |
I am not sure how to build libtk and libtcl with the -g compile option, but happy to do it if you give me some instructions! |
See https://github.com/cpbotha/nvpy/blob/master/docs/ucs-4.rst. This documentation was written 3 years ago for other purpose, but it will still be helpful. The documentation describes build procedure for older version. You are better off building the latest version. The procedure will be almost the same. Build artifacts will be placed on |
Will give this a try and let you know if I am successful |
As soon as I start to type anything or remove any characters in the search box. It starts searching immediately and nvpy freezes for up to 30s with the rest of the ui being unusable until the search is complete.
The first character is the worst, it freezes until the first character has been "searched", and there is another lesser delay on the second character, and less of a delay but still slow for the third. After about the third character, it speeds up significantly with almost no lag(less to search at that point).
So it takes up to a minute to even type the word "test" in the search box, with the application trying to search again every time a character is typed.
Gstyles or regexp both have this issue.
Pasting a full word or partial word above three characters is much faster, almost immediately gives results. Pasting "test" searches test with no freeze or lag.
Have installed and reinstalled the latest version, deleted notes and done full resync, replaced cfg, etc.
Anything I am missing to make this faster?
I don't remember this being the case a few versions back, and I had a similar volume of notes.
If there is no easy fix, I propose a 1 sec delay to be added after characters start to be modified in the search box, so that by the time nvpy starts to search, there are likely already 3+ characters and no hang up ever begins.
Thanks!
The text was updated successfully, but these errors were encountered: