New issue
Advanced search Search tips

Issue 612369 link

Starred by 2 users

Issue metadata

Status: Archived
Owner: ----
Closed: Jun 2017
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug



Sign in to add a comment

TemplateURLPrepopulateData::GetEngineType() works slowly and slows the omnibox down

Reported by vit...@yandex-team.ru, May 17 2016

Issue description

UserAgent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:46.0) Gecko/20100101 Firefox/46.0

Steps to reproduce the problem:
1. Add macro TRACE_EVENT0 to the function TemplateURLPrepopulateData::GetEngineType().
2. Change the default search engine to Yandex or Nigma.
3. Activate tracing and type some words to the omnibox
4. See that TemplateURLPrepopulateData::GetEngineType() uses too much CPU time (about 28% of the wall duration of AutocompleteController::Start()).

What is the expected behavior?
TemplateURLPrepopulateData::GetEngineType() uses nearly zero CPU time.

What went wrong?
TemplateURLPrepopulateData::GetEngineType() uses too much CPU time.

Did this work before? N/A 

Chrome version: <Copy from: 'about:version'>  Channel: n/a
OS Version: 6.1 (Windows 7, Windows Server 2008 R2)
Flash Version: Shockwave Flash 21.0 r0

If the default search is Google then TemplateURLPrepopulateData::GetEngineType() uses much lesser CPU time. See my screenshotes for details.
 
GetEngineType_DefaultIsYandex.png
51.9 KB View Download
GetEngineType_DefaultIsNigma.png
51.9 KB View Download
GetEngineType_DefaultIsGoogle.png
52.2 KB View Download
I've found that TemplateURLPrepopulateData::GetEngineType() is called for the default search engine on each autocomplete and the previous result of that call is not stored anywhere. Furthermore, the engine type is always calculated even for prepopulated engines and it makes little sense because we know the engine type of any prepopulated engine beforehand.
Project Member

Comment 3 by bugdroid1@chromium.org, Jun 14 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/da6a5018316e1a0912e606bdca9b06dc03ff567d

commit da6a5018316e1a0912e606bdca9b06dc03ff567d
Author: vitbar <vitbar@yandex-team.ru>
Date: Tue Jun 14 18:20:32 2016

Cache SearchEngineType of TemplateURL.

TemplateURLPrepopulateData::GetEngineType() is slow and frequently called even for prepopulated engines. This patch fixes it.

BUG= 612369 

Review-Url: https://codereview.chromium.org/1983773002
Cr-Commit-Position: refs/heads/master@{#399752}

[modify] https://crrev.com/da6a5018316e1a0912e606bdca9b06dc03ff567d/chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc
[modify] https://crrev.com/da6a5018316e1a0912e606bdca9b06dc03ff567d/chrome/browser/search/local_ntp_source.cc
[modify] https://crrev.com/da6a5018316e1a0912e606bdca9b06dc03ff567d/chrome/browser/ui/app_list/app_list_view_delegate.cc
[modify] https://crrev.com/da6a5018316e1a0912e606bdca9b06dc03ff567d/chrome/browser/ui/app_list/start_page_service.cc
[modify] https://crrev.com/da6a5018316e1a0912e606bdca9b06dc03ff567d/components/ntp_tiles/popular_sites.cc
[modify] https://crrev.com/da6a5018316e1a0912e606bdca9b06dc03ff567d/components/omnibox/browser/base_search_provider.cc
[modify] https://crrev.com/da6a5018316e1a0912e606bdca9b06dc03ff567d/components/omnibox/browser/search_provider.cc
[modify] https://crrev.com/da6a5018316e1a0912e606bdca9b06dc03ff567d/components/search_engines/prepopulated_engines.json
[modify] https://crrev.com/da6a5018316e1a0912e606bdca9b06dc03ff567d/components/search_engines/search_engine_type.h
[modify] https://crrev.com/da6a5018316e1a0912e606bdca9b06dc03ff567d/components/search_engines/template_url.cc
[modify] https://crrev.com/da6a5018316e1a0912e606bdca9b06dc03ff567d/components/search_engines/template_url.h
[modify] https://crrev.com/da6a5018316e1a0912e606bdca9b06dc03ff567d/components/search_engines/template_url_prepopulate_data.cc
[modify] https://crrev.com/da6a5018316e1a0912e606bdca9b06dc03ff567d/components/search_engines/template_url_prepopulate_data.h
[modify] https://crrev.com/da6a5018316e1a0912e606bdca9b06dc03ff567d/components/search_engines/template_url_prepopulate_data_unittest.cc
[modify] https://crrev.com/da6a5018316e1a0912e606bdca9b06dc03ff567d/components/search_engines/template_url_service.cc

Project Member

Comment 4 by bugdroid1@chromium.org, Jun 15 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/da6a5018316e1a0912e606bdca9b06dc03ff567d

commit da6a5018316e1a0912e606bdca9b06dc03ff567d
Author: vitbar <vitbar@yandex-team.ru>
Date: Tue Jun 14 18:20:32 2016

Cache SearchEngineType of TemplateURL.

TemplateURLPrepopulateData::GetEngineType() is slow and frequently called even for prepopulated engines. This patch fixes it.

BUG= 612369 

Review-Url: https://codereview.chromium.org/1983773002
Cr-Commit-Position: refs/heads/master@{#399752}

[modify] https://crrev.com/da6a5018316e1a0912e606bdca9b06dc03ff567d/chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc
[modify] https://crrev.com/da6a5018316e1a0912e606bdca9b06dc03ff567d/chrome/browser/search/local_ntp_source.cc
[modify] https://crrev.com/da6a5018316e1a0912e606bdca9b06dc03ff567d/chrome/browser/ui/app_list/app_list_view_delegate.cc
[modify] https://crrev.com/da6a5018316e1a0912e606bdca9b06dc03ff567d/chrome/browser/ui/app_list/start_page_service.cc
[modify] https://crrev.com/da6a5018316e1a0912e606bdca9b06dc03ff567d/components/ntp_tiles/popular_sites.cc
[modify] https://crrev.com/da6a5018316e1a0912e606bdca9b06dc03ff567d/components/omnibox/browser/base_search_provider.cc
[modify] https://crrev.com/da6a5018316e1a0912e606bdca9b06dc03ff567d/components/omnibox/browser/search_provider.cc
[modify] https://crrev.com/da6a5018316e1a0912e606bdca9b06dc03ff567d/components/search_engines/prepopulated_engines.json
[modify] https://crrev.com/da6a5018316e1a0912e606bdca9b06dc03ff567d/components/search_engines/search_engine_type.h
[modify] https://crrev.com/da6a5018316e1a0912e606bdca9b06dc03ff567d/components/search_engines/template_url.cc
[modify] https://crrev.com/da6a5018316e1a0912e606bdca9b06dc03ff567d/components/search_engines/template_url.h
[modify] https://crrev.com/da6a5018316e1a0912e606bdca9b06dc03ff567d/components/search_engines/template_url_prepopulate_data.cc
[modify] https://crrev.com/da6a5018316e1a0912e606bdca9b06dc03ff567d/components/search_engines/template_url_prepopulate_data.h
[modify] https://crrev.com/da6a5018316e1a0912e606bdca9b06dc03ff567d/components/search_engines/template_url_prepopulate_data_unittest.cc
[modify] https://crrev.com/da6a5018316e1a0912e606bdca9b06dc03ff567d/components/search_engines/template_url_service.cc

Project Member

Comment 5 by bugdroid1@chromium.org, Jun 16 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/3347145ed88430cfbac820254ca14ffec5a001af

commit 3347145ed88430cfbac820254ca14ffec5a001af
Author: vitbar <vitbar@yandex-team.ru>
Date: Thu Jun 16 08:18:57 2016

Bump kCurrentDataVersion in prepopulated_engines.json.
This CL fixes bad rebase in https://codereview.chromium.org/1983773002/

BUG= 612369 

Review-Url: https://codereview.chromium.org/2065163008
Cr-Commit-Position: refs/heads/master@{#400109}

[modify] https://crrev.com/3347145ed88430cfbac820254ca14ffec5a001af/components/search_engines/prepopulated_engines.json

Project Member

Comment 6 by sheriffbot@chromium.org, Jun 16 2017

Status: Archived (was: Unconfirmed)
Issue has not been modified or commented on in the last 365 days, please re-open or file a new bug if this is still an issue.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot

Sign in to add a comment