Performance hit when using Encryption plugin
- Dominant language
- C++
- Stars
- 12.3k
- Forks
- 593
- Avg merge
- 2d 8h
- Merged PRs (30d)
- 9
Description
Before creating a new issue, see list of [known
issues](https://copyq.readthedocs.io/en/latest/known-issues.html).
**Describe the bug**
A noticeable performance hit is observed when using the Encryption plugin that lasts several minutes and causes the application to freeze.
**To Reproduce**
Steps to reproduce the behavior:
1. install any version of CopyQ built after [a7a891e1](https://github.com/hluk/CopyQ/commit/a7a891e1f84c6c046a7bfc904c5fc6ebb98dec94)
2. configure encrypted tab history to 5000 items
3. populate clipboard history with items
4. configure Encryption plugin
5. click Apply
**Expected behavior**
The Preferences window closes and the settings take effect
**Screenshots**
I could probably provide a video/screen recording on demand
**Version, OS and Environment**
(Get details from `copyq version` command if possible.)
- Application Version 7.1.0-20-g19e9dd1c
- OS Microsoft Windows [Version 10.0.22621.2428]
**Additional context**
I believe the issue is a bottleneck between gpg and CopyQ that occurs when CopyQ is launched (while the encryption plugin is enabled) or after clicking Ok/Apply from the preferences window when the encryption plugin is enabled and there's a significant number of items being encrypted/decrypted. I'm not sure what exactly is happening in the background that causes this, but I suspect CopyQ is calling gpg to load/decrypt all of the items in the encrypted tab into memory which causes CopyQ to lock up until that operation has finished. It's also worth noting I saw similar performance prior to the recent rewrite of the plugin, to clarify this behavior isn't new.
At minimum, additional details in CopyQ's docs as it applies to the encryption plugin about what exactly is causing this performance bottleneck and what can be done to mitigate it would be appreciated. Adding asynchronous support (if possible, see https://stackoverflow.com/questions/59667777/truly-asynchronous-file-io-in-c) would be greatly appreciated.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.