Comments (9)
There should be a number of trivial perf improvements that can be made -- I'll look into them in the coming days.
from clipmenu.
It should be DEBUG=1
, not DEBUG=true
(it's checked with ((
and (( true ))
is false. :-)
from clipmenu.
The cause are large amounts of entries in /tmp/clipmenu.$USER
. I had 500 in there and it slowed it down to >2sec. One needs to clean this directory regulary.
from clipmenu.
Part one of perf improvements is in e8ba60e, which improves performance on my machine by a little over 30%:
clipmenu perf_old % TIME_ONLY=1 test/test-perf
>>> Setting up edited clipmenu
>>> Writing 1500 clipboard files
0... 100... 200... 300... 400... 500... 600... 700... 800... 900... 1000... 1100... 1200... 1300... 1400... 1500... done
>>> Running modified clipmenu
real 0m5.238s
user 0m0.380s
sys 0m0.350s
clipmenu perf_old % NO_RECREATE=1 TIME_ONLY=1 test/test-perf
>>> Setting up edited clipmenu
>>> Not nuking/creating new clipmenu files
>>> Running modified clipmenu
real 0m5.166s
user 0m0.270s
sys 0m0.470s
clipmenu perf_old % gco perf
Switched to branch 'perf'
clipmenu perf % TIME_ONLY=1 test/test-perf
>>> Setting up edited clipmenu
>>> Writing 1500 clipboard files
0... 100... 200... 300... 400... 500... 600... 700... 800... 900... 1000... 1100... 1200... 1300... 1400... 1500... done
>>> Running modified clipmenu
real 0m3.356s
user 0m1.100s
sys 0m1.130s
clipmenu perf % NO_RECREATE=1 TIME_ONLY=1 test/test-perf
>>> Setting up edited clipmenu
>>> Not nuking/creating new clipmenu files
>>> Running modified clipmenu
real 0m3.309s
user 0m1.180s
sys 0m0.950s
from clipmenu.
f0fe969 brings us down further to 1.5 seconds:
clipmenu perf % TIME_ONLY=1 test/test-perf
>>> Setting up edited clipmenu
>>> Writing 1500 clipboard files
0... 100... 200... 300... 400... 500... 600... 700... 800... 900... 1000... 1100... 1200... 1300... 1400... 1500... done
>>> Running modified clipmenu
real 0m1.495s
user 0m0.430s
sys 0m1.070s
from clipmenu.
I think you'll find the new version about to be pushed to develop makes things much better, test out 6edf3c4. This commit makes running time with 1500 clips basically nothing:
clipmenu perf % TIME_ONLY=1 test/test-perf
>>> Setting up edited clipmenu
>>> Writing 1500 clipboard files
0... 100... 200... 300... 400... 500... 600... 700... 800... 900... 1000... 1100... 1200... 1300... 1400... 1500... done
>>> Running modified clipmenu
real 0m0.015s
user 0m0.010s
sys 0m0.000s
from clipmenu.
Cleaned up now unneeded code and sped up further in 8885306:
clipmenu perf % TIME_ONLY=1 test/test-perf
>>> Setting up edited clipmenu
>>> Writing 1500 clipboard files
0... 100... 200... 300... 400... 500... 600... 700... 800... 900... 1000... 1100... 1200... 1300... 1400... 1500... done
>>> Running modified clipmenu
real 0m0.004s
user 0m0.000s
sys 0m0.000s
from clipmenu.
I just released 2.0.0 here (as a git tag) and on the AUR. It should be way more performant, but note that as a result of the performance improvements it is backwards incompatible, your old clips will not show up in 2.0.0.
Test it out and let me know what you think. :-)
from clipmenu.
Been using 09c32b0 this morning and so far so good. 👏 Nice work.
~$ git --git-dir ~/tmp/clipmenu/.git/ describe
2.0.0
~$ cat /home/hendry/.config/systemd/user/clipmenud.service
[Unit]
Description=Clipmenud
[Service]
Environment=DISPLAY=:0
Environment=DEBUG=true
ExecStart=/usr/local/bin/clipmenud
[Install]
WantedBy=default.target suspend.target
~$ systemctl --user status clipmenud.service
● clipmenud.service - Clipmenud
Loaded: loaded (/home/hendry/.config/systemd/user/clipmenud.service; enabled; vendor preset: enabled)
Active: active (running) since Fri 2017-01-06 23:39:24 SGT; 12h ago
Main PID: 2067 (clipmenud)
CGroup: /user.slice/user-1000.slice/[email protected]/clipmenud.service
├─ 2067 /bin/bash /usr/local/bin/clipmenud
├─31437 xsel -i --clipboard
└─32546 sleep 0.5
Jan 06 23:39:24 teefour systemd[2047]: Started Clipmenud.
~$ journalctl --user -u clipmenud.service -f
-- Logs begin at Fri 2016-04-15 20:16:20 SGT. --
Jan 02 22:55:44 teefour systemd[1959]: Started Clipmenud.
Jan 04 00:09:33 teefour systemd[1959]: Stopping Clipmenud...
Jan 04 00:09:33 teefour systemd[1959]: Stopped Clipmenud.
-- Reboot --
Jan 04 09:24:00 teefour systemd[2017]: Started Clipmenud.
Jan 05 08:56:41 teefour systemd[2017]: Stopping Clipmenud...
Jan 05 08:56:42 teefour systemd[2017]: Stopped Clipmenud.
-- Reboot --
Jan 05 09:17:37 teefour systemd[1972]: Started Clipmenud.
Jan 06 23:38:47 teefour systemd[1972]: Stopping Clipmenud...
Jan 06 23:38:47 teefour systemd[1972]: Stopped Clipmenud.
-- Reboot --
Jan 06 23:39:24 teefour systemd[2047]: Started Clipmenud.
^C
~$ ll /usr/local/bin/clipmenud
lrwxrwxrwx 1 hendry users 26 Jul 26 13:57 /usr/local/bin/clipmenud -> /home/hendry/bin/clipmenud
Was half expecting to see some logging with DEBUG set to true. Probably an issue with my systemd.
from clipmenu.
Related Issues (20)
- Add image support HOT 3
- Option to not store passwords HOT 2
- Put new strings in clipboard from clipmenu HOT 2
- Save Image to a File - no menu entry nor toolbar button HOT 1
- keepassxc vs. clipmenu HOT 6
- Cannot get `$CM_IGNORE_WINDOW` to work HOT 1
- Add man pages HOT 1
- Why might one want to enable CM_OWN_CLIPBOARD=1? HOT 2
- I can't control it via environmental variables HOT 3
- Unrelated question. Insert unicode in terminal. HOT 1
- Choosing selection no longer works HOT 2
- Notifications about clipboard access HOT 1
- Release 6.3.0 HOT 5
- different locations for clipmenud
- compilation failure on archlinux HOT 3
- Support rofi-script in new C version
- Check serial time as part of disable rejection
- [Feature Request] Add itesm to pinned / favorites list HOT 1
- Deduplicate entries HOT 8
- Clipboard history deleting after the reboot HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from clipmenu.