Comments (3)
I've profiled the code and found that the main performance issue for long clipboard contents is in the call to the wait_for_text() method in the GTK clipboard object in the protector instance.
21957 function calls (21021 primitive calls) in 135.465 CPU seco
Ordered by: standard name
ncalls tottime percall cumtime percall filename:lineno(function)
1 0.000 0.000 135.465 135.465 <string>:1(<module>)
1 0.016 0.016 135.463 135.463 pastie:19(<module>)
1 0.000 0.000 97.364 97.364 protector.py:30(__init__)
70 1.412 0.020 99.718 1.425 protector.py:94(check)
70 98.203 1.403 98.203 1.403 {method 'wait_for_text' of 'gtk.Clipboard' objects}
I've found parcellite works even worse, but that glipper can handle this better. I'm checking glipper's source.
from pastie.
Hm... Glipper's clipboard retrieval method is, simply put, not good enough (someonce could say, "just good enough"). It uses the clipboard Gdk Atom's internal event "owner-change", which sadly won't work with some programs, e.g. Gvim "+y. So: wait_for_text() get's called less (and so glipper has better performance), but it won't catch all clipboard changes.
The problem we are having is due to wait_for_text() being called every 500ms in cases where it takes more than that time (1400ms) to actually retrieve the text.
from pastie.
Doesn't fail as hard now. The menu still updates slowly, but doesn't hang.
I've integrated the "owner-change" procedure into pastie, so that past of the issue should be fixed too.
I'm closing this.
from pastie.
Related Issues (20)
- Pastie 0.6.7 Segmentation Fault HOT 15
- "TypeError: Incorrect padding" HOT 1
- Cannot change selection / preferences dialog hotkey
- shortcuts to change clipboard selections HOT 1
- strange error messages on lauch, but it works
- xorg consumes a lot of processor with pastie HOT 2
- Bigger window for Selection Dialog
- Hotkey for choose and paste at the same time HOT 1
- [Feature Request] What about a built-in url shortener? HOT 1
- HDD usage
- ability to paste text with shortcut #whishlist
- Some keyboard shortcuts don't work
- Document supported names for modifier keys
- Support Windows-Modifier key
- Take some ideas from Ditto - the Windows Clipboard Manager
- Add "About" Dialog to Pastie
- encrypt data stored to disk HOT 1
- How to install?
- Can I upload a Chinese translation???? HOT 4
- Dead project? 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 pastie.