lslezak / monkey_scripts

Set of scripts for the Tampermonkey (https://tampermonkey.net/) plugin
GNU General Public License v3.0
7 stars 3 forks source link

bugzilla_links.user.js cripples page performance #3

Closed aspiers closed 4 years ago

aspiers commented 5 years ago

Hi there, thanks a lot for sharing this really nice collection of scripts. I already see

// TODO: optimize this, run the XPath qury once for all bug IDs

in the source for bugzilla_links.user.js, so I'm sure it's not news to you, but I found that enabling this userscript really cripples performance on some pages. In particular on GitHub pull request pages which have a lot of reviews and comments, I see lots of messages like

Bugzilla linking took 435.80 milliseconds

in the console, and it makes typing @username in comment boxes incredibly slow. So unfortunately I have to disable it for now. It would be great if this could be fixed!

lslezak commented 4 years ago

Fixed in version 0.2.0 of the script.

I have added a delayed scan, the document is scanned for bugzilla numbers after 1 second of inactivity. So if you are typing fast the document will be scanned after 1 second when you stop typing.

Also the document was scanned several times which was not necessary, now it runs the scan only once.

The script should be much faster now.