voodoocode / pannengeraet-krank-knarrenbauer

🍳 Replaces Abhörgerät Kommt-Kampfhubschrauber by silly names
MIT License
67 stars 7 forks source link

Performance #11

Closed Basti-an closed 5 years ago

Basti-an commented 5 years ago

Hey Voodoo,

unfortunately, the Extension is not performant because you unconditionally iterate over all DOM nodes on all pages.

if you were to get the whole innerHTML (document.getElementsByTagName('html')[0].innerHTML) of the page first and do a regex search for AKK etc. first to determine wether there even are any textnodes to replace, you could save tons of CPU-cycles.

If you would like to, I could create a pull request and do some performance profiling.

Beste Grüße aus Köln

voodoocode commented 5 years ago

Hi Basti-an,

I already had the same idea, I don't like it either. The whole node looping stuff, was forked from the original repo though and I didn't quite bother it for this fun little project.

So, yes please, I'd appreciate your help.

Grüße aus Köln zurück!

voodoocode commented 5 years ago

I started fiddling around in the branch called "perf":

https://github.com/voodoocode/pannengeraet-krank-knarrenbauer/blob/perf/content.js

voodoocode commented 5 years ago

I already merged that to master, so it should be a bit better now