Skip to content
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

Completely rewrite all core logic using compacting log storage #338

Closed
wants to merge 17 commits into from

Conversation

SUPERCILEX
Copy link

@SUPERCILEX SUPERCILEX commented Jan 20, 2022

This has been released in a rewritten version of the extension: https://extensions.gnome.org/extension/4839/clipboard-history/, https://github.com/SUPERCILEX/gnome-clipboard-history.

Here's what's been fixed:

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>
Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>
Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>
Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>
Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>
Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>
Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>
Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>
Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>
Goals:

- Maximize performance
- Simplify logic and code
- Lay foundation for future development

Key changes:

- Store data using compacting log to minimize disk writes
- Process incoming copies in O(1), doing the minimal amount of work possible
- Fix various other inefficiencies in core logic, bringing time complexity down to O(1) (at the cost of a bit of extra memory sometimes)
- Fixed a bug where max preview lengths were off by 2 characters
- Move favorited items to top when MOVE_ITEM_FIRST is enabled

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>
Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>
Because we're using the *_async functions, our I/O ops can reorder themselves. This becomes a problem if, for example, we mark an entry as favorite before actually adding it.

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>
Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>
…d log ops)

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>
Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>
Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>
Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>
@jacksongoode
Copy link

jacksongoode commented Feb 4, 2022

@SUPERCILEX Could you provide some summary of the improvements of this PR?

@SUPERCILEX
Copy link
Author

Depending on how things go, these changes will either be part of this repo or I'll publish my own version of clipboard indicator. In either case, I'll make announcements on Reddit and write a blog post about the compacting log, fast hashing, and other optimizations once everything is ready. You can track my progress here if you're interested: https://github.com/SUPERCILEX/gnome-shell-extension-clipboard-indicator/commits/master.

The gist of these changes is relatively straightforward: make everything go fast, remove all scaling limitations, make the code more maintainable, and implement useful feature requests where possible.

@lgg
Copy link

lgg commented Feb 7, 2022

@SUPERCILEX please open issues tab on your's fork page.

@SUPERCILEX
Copy link
Author

SUPERCILEX commented Feb 7, 2022

Done!

@SUPERCILEX
Copy link
Author

Also, would you two be willing to do some QA? I can let you know once I'm ready and post instructions here on how to install the updated extension.

@SUPERCILEX
Copy link
Author

cc @b00f who might be interested, I've seen your name pop up a bunch

@jacksongoode
Copy link

Sure, I've already been using your build for a few days actually! It does feel a little snappier, but there's this interesting lag that still exists when toggling the extension and then hovering over the system menu and back to indicator. This lag existed in the upstream as well but I was wondering if your changes had addressed it.

@SUPERCILEX
Copy link
Author

Hmmm, not sure what you mean. As in, you put your mouse over the clipboard icon and then move it to the wifi icon?

@jacksongoode
Copy link

Yes, exactly - while the popup is toggled, so switching from the system dropdown (volumne, mic, brightness, etc.) to the clipboard dropdown causes some stuttering as the history loads.

@SUPERCILEX
Copy link
Author

Ohhhhhh, I think I have a guess for what's going on! We only build the menu UI after loading all the items, and since that takes a while you won't see anything for a bit. Will take a look later and let you know if that's it.

@SUPERCILEX
Copy link
Author

@jacksongoode the slow start issue should be fixed. 🎉

@luisalvarado
Copy link

Jesus christ am just seeing this. Can you please tell me what type of coffee you drank to do this much work. Just amazing!

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.

None yet

4 participants