Data from 99th percentile power investigation show that FindFirstPageURLForHost can be quite expensive in some cases.
It seems that we can make it significantly faster by optimizing
the SQL query in it.
This CL removes the use of LIKE operator and substitutes it with
string comparisons. Local synthetic test shows ~20x speed improvement
for this query.
Bug: 1270809
Change-Id: Icb33828c5bf09a90196428eebd632282175fc471
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3731810
Reviewed-by: Scott Violet <sky@chromium.org>
Commit-Queue: Mikhail Khokhlov <khokhlov@google.com>
Cr-Commit-Position: refs/heads/main@{#1019569}
This function is needed by favicons, which I plan to move to
//components/favicons. To avoid circular deps I'm moving the
function into //components/database_utils. I would have liked
to avoid a component purely for this function, but I couldn't
find a better place.
BUG=1076463
TEST=covered by tests
Change-Id: I0877444883eaf9f5f081d4a107879fe4b58697f6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2309034
Reviewed-by: Peter Kotwicz <pkotwicz@chromium.org>
Commit-Queue: Scott Violet <sky@chromium.org>
Cr-Commit-Position: refs/heads/master@{#790674}