find icon indicating copy to clipboard operation
find copied to clipboard

Performance comparison vs default Ctrl-F

Open azhx opened this issue 3 years ago • 1 comments

I'm wondering how the performance of this extension compares to ctrl-F, if you've done any such benchmarking. One specific thing I'm curious if you know about is how Ctrl-F is rendering their text highlights. From a cursory glance at chrome/firefox devtools for example, it doesn't seem like they need to wrap highlighted text in spans--I assume they have some lower level api that handles this. Do you know how that works?

azhx avatar Feb 23 '22 22:02 azhx

Hey @azhx, thanks for your interest in Find+!

The performance of this extension is certainly worse than the native tool, purely because this extension works by manipulating the DOM (and is written in JavaScript) while the native find in page tool is written in C++ and is more closely tied to the internals of the browser rendering engine. This extension really struggles with large pages because there's a lot of work that goes into traversing the DOM, wrapping text in inline elements, and scanning for matches. Not to mention that a lot of that work is done serially, in a single thread. The native tool performs better.

When I first built this extension, I went digging through the Chromium source code to track down the implementation of the native find-in-page tool, but I don't remember the specifics.

To answer your question though, I have never done any performance benchmarks.

brandon1024 avatar Feb 25 '22 17:02 brandon1024