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

Very slow to paste clipboard contents #38

Open
MountainX opened this issue Dec 4, 2022 · 5 comments
Open

Very slow to paste clipboard contents #38

MountainX opened this issue Dec 4, 2022 · 5 comments
Labels
help wanted Extra attention is needed

Comments

@MountainX
Copy link

MountainX commented Dec 4, 2022

Short description

Extension is very slow to paste formatted URL

Steps to reproduce

  1. Start Firefox with clean profile.
  2. Install MTH version 3.1.11
  3. Define custom format - see below. Edit. It is slow even with default formats.
  4. Copy a URL to clipboard
  5. Paste it.

This is my custom format meant to be used at https://pubmed.ncbi.nlm.nih.gov/

[\(AUTHOR YEAR\)][%REPLACE("%URL%", ".*pubmed.ncbi.nlm.nih.gov/(\d+)/", "$1")%]%EOL%[%REPLACE("%URL%", ".*pubmed.ncbi.nlm.nih.gov/(\d+)/", "$1")%]: %URL% (%MD_LINK_TITLE_SAFE(%TITLE%)%)

Expected result

Text is pasted nearly instantly.

Actual result

It requires 10 to 13 seconds before the clipboard contents are pasted (and my desktop environment becomes unresponsive). BTW, I'm working on a fast desktop computer with lots of RAM, etc.

I use the extension's menu to copy the URL. Then I use CTRL-v to paste it. After entering CTRL-v, there is a delay of 10+ seconds where nothing happens and my system appears non-responsive. After that delay, I get a desktop popup notification (in KDE) and the item is pasted from the clipboard.

I do not have any slowness or non-responsive at any other time from any other applications.

Here's an example:

[\(AUTHOR YEAR\)][28728020]
[28728020]: https://pubmed.ncbi.nlm.nih.gov/28728020/ (Neuroscience-Inspired Artificial Intelligence - PubMed)

The first time I tested this extension, I installed it to a clean FF profile and copy/pasted the markdown format. No problems. Then I defined my custom format and it was slow (as I had seen on my regular Firefox profile).

However, when I went back and tested the standard markdown format, it was very slow now too. I reverted my changes and it remained slow.

BTW, side question, does anyone know if I can automatically capture the citation authors and publication date? This info is in the meta data:

<meta name="citation_authors" content="Hassabis D;Kumaran D;Summerfield C;Botvinick M;">

Environment

  • Platform (OS): Arch Linux
  • Version of Firefox: 107.0.1 (64-bit)
  • Version (or revision) of Multiple Tab Handler: 3.1.11
@piroor
Copy link
Owner

piroor commented Dec 5, 2022

I've tried it on Firefox 107 on Windows 10 with URLs:

https://pubmed.ncbi.nlm.nih.gov/28728020/
https://pubmed.ncbi.nlm.nih.gov/26185246/
https://pubmed.ncbi.nlm.nih.gov/34649035/
https://pubmed.ncbi.nlm.nih.gov/19386468/
https://pubmed.ncbi.nlm.nih.gov/28826509/

and I got a copied text immediately:

[\(AUTHOR YEAR\)][28728020]
[28728020]: https://pubmed.ncbi.nlm.nih.gov/28728020/ (Neuroscience-Inspired Artificial Intelligence - PubMed) 
[\(AUTHOR YEAR\)][26185246]
[26185246]: https://pubmed.ncbi.nlm.nih.gov/26185246/ (Computational rationality: A converging paradigm for intelligence in brains, minds, and machines - PubMed) 
[\(AUTHOR YEAR\)][34649035]
[34649035]: https://pubmed.ncbi.nlm.nih.gov/34649035/ (Natural and Artificial Intelligence: A brief introduction to the interplay between AI and neuroscience research - PubMed) 
[\(AUTHOR YEAR\)][19386468]
[19386468]: https://pubmed.ncbi.nlm.nih.gov/19386468/ (Intelligence in the brain: a theory of how it works and how to build it - PubMed) 
[\(AUTHOR YEAR\)][28826509]
[28826509]: https://pubmed.ncbi.nlm.nih.gov/28826509/ (Infrastructural intelligence: Contemporary entanglements between neuroscience and AI - PubMed) 

Could you try with formats containing less placeholders by removing each placeholder step by step?

And, if you see the problem with old Firefox like Firefox ESR91, could you collect performance profile? Here is a document for my another addon: https://github.com/piroor/treestyletab/wiki/How-to-inspect-tree-of-tabs#how-to-collect-a-performance-profile but the method is unavailable on recent versions of Firefox due to disabled performance profiler for addons. Firefox ESR91 is a version with available performance profiler for addons.

@piroor piroor added the help wanted Extra attention is needed label Dec 5, 2022
@MountainX
Copy link
Author

Thank you for replying. I did test it further and the "copy-selected-tabs-to-clipboard" extension is slow for me with any format, including the default ones (like title & url).

I found that I consistently get these entries in the journal every time I copy a new url with the extension and then paste it.

Dec 04 15:46:07 laptop plasmashell[3636]: Could not find the Plasmoid for Plasma::FrameSvgItem(0x55d62b9b8890) QQmlContext(0x55d626b7d6b0) QUrl("file:///usr/share/plasma/plasmoids/org.kde.plasma.notifications/contents/ui/global/Globals.qml")
Dec 04 15:46:07 laptop plasmashell[3636]: Could not find the Plasmoid for Plasma::FrameSvgItem(0x55d62b9b8890) QQmlContext(0x55d626b7d6b0) QUrl("file:///usr/share/plasma/plasmoids/org.kde.plasma.notifications/contents/ui/global/Globals.qml")
Dec 04 15:46:07 laptop plasmashell[3636]: file:///usr/share/plasma/plasmoids/org.kde.plasma.notifications/contents/ui/NotificationItem.qml:222:21: QML SelectableLabel: Binding loop detected for property "implicitWidth"
Dec 04 15:46:07 laptop plasmashell[3636]: file:///usr/share/plasma/plasmoids/org.kde.plasma.notifications/contents/ui/NotificationItem.qml:222:21: QML SelectableLabel: Binding loop detected for property "implicitWidth"
Dec 04 15:46:07 laptop plasmashell[3636]: file:///usr/share/plasma/plasmoids/org.kde.plasma.notifications/contents/ui/NotificationItem.qml:222:21: QML SelectableLabel: Binding loop detected for property "implicitHeight"
Dec 04 15:46:07 laptop plasmashell[3636]: file:///usr/lib/qt/qml/org/kde/plasma/components.3/ScrollView.qml:45:27: QML ScrollBar: Binding loop detected for property "visible"
Dec 04 15:46:07 laptop plasmashell[3636]: file:///usr/lib/qt/qml/org/kde/plasma/components.3/ScrollView.qml:45:27: QML ScrollBar: Binding loop detected for property "visible"

It is possible this is a KDE-specific problem. All those mentioned files exist on my system. I'm on plasmashell version 5.26.4. Maybe it is a bug.

@glaebhoerl
Copy link

FWIW, I can confirm that I also use Firefox under Linux and KDE and experience the same issue, although I use the extension sparingly so it's just a minor annoyance and not a big deal. Happy to help investigate if there's anything I should check.

A minor wrinkle: the issue occurs often, but not always; sometimes it's instant. I don't have a clear sense of what makes the difference, though it miiiight be related to whether it's the first or Nth invocation (in a given period of time?), which would also happen to track with @MountainX's original report. (But again, this is just a vague, low-confidence intuition.)

@Xananax
Copy link

Xananax commented Sep 22, 2023

Same, also using KDE + Firefox. I removed the option to show a notification just now, and after a couple of tests, it seems that resolves the issue.

image

Seems to have something to do with the notification server.

@FichteFoll
Copy link

FichteFoll commented Mar 22, 2024

I also seem to have trouble with this extension. I'm running i3 on Arch (all latest versions, including FF at 124) and below I have included a screenshot of about:performance after I triggered the extension and the notification (that I configured to show up) hasn't shown yet. You can see high usage of cpu on the core and the extensions process while the extensions process also accumulates a lot of memory.

2024-03-22_12-09-01

I then disabled the setting to send the notification, proceeded to copy the ~20 tab urls manually and closed them (as well as the entire separate window). Afterwards, my clipboard was filled with the list of tabs I requested to copy before, the cpu usage was down to basically 0% and the Extensions' RAM usage is back to ~200MB.

I'll see if this continues to show up with the option disabled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

5 participants