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

Unlimited history #25

Open
CyberShadow opened this issue May 25, 2016 · 10 comments
Open

Unlimited history #25

CyberShadow opened this issue May 25, 2016 · 10 comments

Comments

@CyberShadow
Copy link

Hi,

The Windows open-source clipboard manager Ditto has an unique feature which I've yet to find in any Linux clipboard manager: unlimited history.

That is, there can be no limit to the number of stored entries. All entries are saved in an SQLite database, which is indexed with SQLite's excellent full text indexing. This allows incrementally searching through hundreds of thousands of clipboard entries in seconds.

I have found this to be incredibly convenient, as it means that I can always cut instead of delete anything, with the peace of mind that I can always recover it later. It also allows me to quickly paste in code snippets written any amount of time ago.

Would this be a viable feature request for this project?

@memeplex
Copy link

Is this so different than, say, set history size to 50000000?

What I would find more useful is a handy way to specify "output all entries" with -n since writing 50000000 is a bit cumbersome at the CLI.

@mrichar1
Copy link
Owner

mrichar1 commented Feb 19, 2017

@memeplex I've just taken a look at the code for this, and since the value of -nis just used to slice the history list, I've very slightly modified the code so that -n can now take 0 and negative numbers.

clipster -o -n 0 - return entire history.

clipster -o -n " -5" - return all but first 5 items in history. (this odd syntax is due to an argparse bug, fixed in some releases: https://code.google.com/archive/p/argparse/issues/37

Changes are in: 7ff78f1 (plus docs changes in a later commit).

@mrichar1
Copy link
Owner

@CyberShadow apologies for not replying to your original issue sooner... was sure I had!

While the idea of a DB backend is appealing, it does add an extra layer of complexity and dependencies to the code, which I'm not convinced is entirely justified.

As has been pointed out, history size can be set very large (and could probably be made to be unlimited relatively easily by ading config to disable the 'pruning' code).

I'd be interested to know at what history size the current code starts to be noticeably slower (to a human) - if that number is suitably small then I might consider an alternative history backend. I suspect however that the number will be surprisingly large! (for a bit of fun, have a look at https://computers-are-fast.github.io/)

@magnetophon
Copy link

I've been wanting to update this issue for a while now, since clipster has turned slow for me, presumably because of my history size.
Unfortunately my ssd died a few days ago, and now I don'd know what my size was.
All I know is that it was less than 50000 entries, as that is what my history was capped at.

@mrichar1
Copy link
Owner

mrichar1 commented Jun 1, 2018

Just to follow up on this - I've done some rough and ready speed testing.

The 'baseline' speed for the clipster client on my laptop is 0.1secs - i.e if I tell it to output the history when the daemon isn't running, and it exits immediately.

If I query a 'small' history this adds about 0.025secs to the process.

If I generate a 500MB history file, made up of 50,000 10KB entries, it still only adds 0.025secs.

The only thing that is 'slow' is if I then do clipster -o -n 10000 and even then the total time is under a second.

I can't easily test a larger history as I start to run out of memory!

So I'm reluctant to accept that clipster is slowing down for you due to history size - unless of course the history has got slow large that it's starting to move into swap or something?

There are other bugs open related to performance (like #74) which I need to dig into - this might also be the cause of your slowdowns.

@CyberShadow
Copy link
Author

As has been pointed out, history size can be set very large (and could probably be made to be unlimited relatively easily by ading config to disable the 'pruning' code).

I'd be interested to know at what history size the current code starts to be noticeably slower (to a human) - if that number is suitably small then I might consider an alternative history backend. I suspect however that the number will be surprisingly large! (for a bit of fun, have a look at https://computers-are-fast.github.io/)

Hi, sorry also for the late reply - looks like I missed your message.

I don't use Windows (and therefore Ditto) much any longer, but as I've left it, my Ditto database measures at over 7 GB. Suffice to say, keeping it all in RAM would be an unreasonable misuse in resources. The 7 GB figure comes after periodic cleanups for deleting screenshots or other very large (over several MB) clips. The database is currently at 195539 clips, which puts them at a mean size of 37508 bytes per clip (incl. metadata such as search indexes), which to me seems not unreasonable.

Some of the larger clips are things like:

  • log files
  • terminal session transcripts
  • entire source files
  • program outputs
  • chat logs

Again, IMO, not unreasonable.

So, I do still think there is a use case here :)

@magnetophon
Copy link

magnetophon commented Jun 17, 2019

I'd be interested to know at what history size the current code starts to be noticeably slower (to a human) - if that number is suitably small then I might consider an alternative history backend.

Mine is 38M, and very slow.
Getting the output of clipster -o -n 0 -0 | fzf --read0 --no-sort --reverse --preview='echo {}' | sed -ze 's/\n$//' | clipster takes a few seconds, and pasting even longer.
I am in swap though.

@stale
Copy link

stale bot commented Apr 16, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Apr 16, 2022
@stale stale bot closed this as completed Apr 28, 2022
@CyberShadow
Copy link
Author

@mrichar1 Please don't use stale bots, they do more harm than good. Not just in terms of value they bring to the particular project, but they generally erode public trust and willingness to participate in open-source software development.
See the discussions here: https://www.google.com/search?q=stale+bot+site%3Aycombinator.com

@mrichar1 mrichar1 reopened this Apr 28, 2022
@stale stale bot removed the stale label Apr 28, 2022
@mrichar1
Copy link
Owner

The stalebot was actually added in August last year with a view to tweaking it to do minimal tidying. Unfortunately it never fired, so I forgot about it until this last week when it 'woke up'. Unfortunately I was away so missed the pending stale events to stop it before it happened.

I generally try to apply tags to 'pending' issues which haven't been fully resolved and had configured stalebot to ignore some of these - but unfortunately missed a couple, which is why so many 'useful' issues got closed. I've now reopened all of these so they can continue to receive input.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants