-
Notifications
You must be signed in to change notification settings - Fork 50
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
Performance hit while using the KeeTrayTOTP column on large databases #27
Comments
Hi, thanks for reporting in such detail. I tried the steps this morning using your test database, but I could not yet get it reproduced. I had YAFD already, and installed the HIBP Offline plugin just yet (without a password file though).
|
Hello again, if you try and add a few more TOTP's in the Database file? And then try to scroll? I mean, it could be that my computer is the culprit? I'm on a Dell 9570 ( i7 / with 1050 Ti Q-max ). Maybe there is something I can do on my side. But I swear, once I enable the TOTP column, the fans start to spin immediately: And once I disable it again, it quickly goes down to normal: Steps I take ( updated ):
For this I am only using the TOTP plugin enabled. |
Hi, had the same issues, it has something to do with the fields you display in KeePass, try reducing it to a minimum. |
I've been investigating this one. When the column is enabled a timer will try and update the otp code every second ( For now I don't have a definite solution. I'll have to take a look at the source code of Keepass if such a method exists. We could touch the password entry, which might trigger a repaint, but that would also prompt you to save the database when exiting so I'd rather not do that. Otherwise we might have to reach out to the Keepass author. |
This is by no means stable and a questionable solution. * Did a lot of refactors that might be moved to a separate branch. * Added a build / run configuration for the database provided in the issue. It contains 2000 entries which is already a lot to choke on for KeePass itself, let alone the custom column * Reproduce by enabling the TOTP column via View > Configure Columns. Gotcha's: * Tried to locate the KeePass's listview based on it's name and type. Probably not the way a plugin should extend the functionality * In the old implementation the timer would trigger a redraw for all the items in the listview. In the new this code tries to locate entries that have TOTP settings and keepps them in a few dictionaries to prevent repainting / looping through all the items. That means the cache has to be invalidated on certain conditions. I did not really look for events that we can subscribe to, but the old implementation kept track of the selected group. The new one invalidates when the number of items change, of the modification time changes on one of the tracked entries. * Tried to keep the old otp value around to prevent recalculating a perfectly valid value. Thoughts: * What are the security concerns for keeping TOTP code's around. I guess this also applies to the current implementation as the otp code was recalculated every few seconds and is visible in the UI. * Double clicking the column invokes an action on the column provider, so we could also chose to show a text "Double click to copy TOTP code". On the other side we already have a Ctrl-T for the current selection, so what is the purpose of the column anyway? * If the idea is to show all TOTP codes for your entries, we could remove the column functionality alltogether and create a separate window where you can view all your TOTP Entries (like Google Authenticator).
So, a long story short:
I've had problems with what I thought was @navossoc's YAFD plugins fault. However, it seems to be KeeTrayTOTP that is the culprit;
I received the following error code in Windows 10 (latest build), running KeePass 2.40 and KeeTrayTOTP 0.9.5.0 combined with HIBPOffline plugin and YAFD:
As you can see, it breaks during list repaint. This happens when using the column TOTP _(Using either open view or asteriks) with any number of entries present. What is more, is that if used with a large number of entries such as this test Database.zip (password to open db is
123
(there is no password on the zip file itself.)) You can clearly see the effect of the seconds counter working the list every second.I've noticed some sluggishness on my main db (around 300-350 entries spanned ~10 groups as well, so it is definitively a performance hit.
Note: Using the column feature of KeeTrayTOTP with other plugins that require list repaint can potentially corrupt data during save, and any change is definitively lost when KeePass crash. So do not try this on your mainDB.
Let me know if you need anything else.
The text was updated successfully, but these errors were encountered: