-
Sebastien Lalancette authored
This fixes the issue where Chrome would hang if the user had a lot (tested with 5000) profiles. After debugging, the following bottlenecks were identified (listed in order of execution): - Finding matching profiles (impact small), - Deduping matching profiles to create a unique set (impact medium), - Calculating width of every rows (impact high), - Eliding strings (impact high) The approach this CL is taking to solving the issue is to limit the number of profiles that are shown to the user. This is done gradually to optimize perf while keeping the same precision. Effectively, in the worst case, we are limiting our search to: - Find the first 50 matching profiles, - Dedupe matching profiles until you have 10 unique to show. This way we are optimizing where perf cost is high, while keeping our results relevant since users will get other results not shown by default as they keep typing. Metrics considered for choosing the numbers: 50 matching profiles: - Very few users have more than 3 profiles, but recorded extreme cases go up to 53 (see UMA chart link), - Since perf cost for this part of the code is not high, we can accommodate these extreme cases. 10 suggestions: - Over 99% of our users will choose a suggestion that is within the first 10 suggestions. Fixes: 753481 Change-Id: I59a9529f9ba4cf6da56a1c1167aa6bb7562d0f81 Reviewed-on: https://chromium-review.googlesource.com/c/1343609Reviewed-by:
Sebastien Seguin-Gagnon <sebsg@chromium.org> Reviewed-by:
Fabio Tirelo <ftirelo@chromium.org> Commit-Queue: Sebastien Lalancette <seblalancette@chromium.org> Cr-Commit-Position: refs/heads/master@{#611089}
c6b97a0f