New issue
Advanced search Search tips

Issue 665332 link

Starred by 2 users

Issue metadata

Status: WontFix
Owner: ----
Closed: May 2018
Cc:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug



Sign in to add a comment

Startup performance regressed due to ICU changes

Project Member Reported by asvitk...@chromium.org, Nov 15 2016

Issue description

Startup performance regressed due to ICU changes.

According to UMA sampling profiler, GetScriptOfBrowserLocale - which is backed by ICU - regressed recently. It's called on the startup codepath and in 55.0.2880.4 Canary it took 18ms on average while in 56.0.2914.1 Canary it now takes 32ms.

Here's the data:
https://uma.googleplex.com/callstacks?sid=138ba35b17579bd1bb99c25371bb9726
https://uma.googleplex.com/callstacks?sid=756e3d4cb5cbe9d8fa96538b74741d66

The links above show the call breakdown where time is being spent.

jshin@, could you take a look?
 
Specifically, res_getTableItemByKey is responsible for 12ms now whereas before it spent very little time:

https://uma.googleplex.com/callstacks?sid=9fd0c33ea08dd28679c5b8ed04f8b1d4
https://uma.googleplex.com/callstacks?sid=0a0cd4f187ef7bee6ca5a2ffdf850516

Comment 2 by js...@chromium.org, Nov 15 2016

Hmm.... |init_entry| in icu/source/common/uresbund.cpp didn't change between ICU 56 and 58. According to the UMA, it's |init_entry| that calls res_getTableItemByKey, but I couldn't find a connection between two (didn't look hard enough, though). And in m56, res_getTableItemByKey did not show up at all. 

BTW, icu/source/data/misc/likelySubtags.txt got bigger by more than 50% (1173 entries to 1804 entries). That may partly account for slow down. 

Right, it could be that the input data file is such that it makes the performance of that function much slower.

I suspect init_entry() calls something that calls res_getTableItemByKey() and that intermediate thing gets inlined.

Comment 4 by js...@chromium.org, Nov 18 2016

A few alternatives (if I can't speed up ICU):

1. Do not call GetScriptOfBrowserLocale(). As commented in the file, it may not be necessary now that we have a font configuration extension (available for install from Settings page) for per-script font settings. 

2. Hardcode 'locales to script' mapping for more frequently used UI locales (we already do that for CJK anyway). 

3. Drop newly added entries in likelySubtags.txt (if that indeed caused the slow down). 

BTW, what's a good way to collect the stat for start-up performance 'locally' (as opposed to UMA)?  
Cc: wittman@chromium.org
+wittman

I'm not sure there's a good way to repro things locally in the same way that UMA Sampling Profiler is capturing things - but maybe wittman@ has ideas.

Otherwise, you could try just recording base::TimeTicks::Now() around the call and subtracting the difference to see if that shows an effect.
Timing using base::TimeTicks::Now() when running Chrome from a cold start is likely to be the best approximation you can do locally. (Most startup slowdown is due to waiting on I/O.)

Comment 7 by js...@chromium.org, May 22 2018

Cc: js...@chromium.org
Owner: ----
Status: Untriaged (was: Assigned)
Status: WontFix (was: Untriaged)
Triage: WontFixing due to inactivity. Feel free to reopen if there's more data.

Sign in to add a comment