Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(104)

Issue 1525963002: (CANCELED) Improve performance of large option list with CJK text (Closed)

Created:
5 years ago by kojii
Modified:
5 years ago
Reviewers:
tkent, drott, eae
CC:
chromium-reviews, krit, szager+layoutwatch_chromium.org, drott+blinkwatch_chromium.org, Rik, zoltan1, blink-reviews-platform-graphics_chromium.org, blink-reviews-layout_chromium.org, pdr+renderingwatchlist_chromium.org, eae+blinkwatch, leviw+renderwatch, Justin Novosad, jbroman, danakj, pdr+graphicswatchlist_chromium.org, f(malita), jchaffraix+rendering, blink-reviews, vmpstr+blinkwatch_chromium.org, Stephen Chennney, dshwang, rwlbuis
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Improve performance of large option list with CJK text This patch adds Font::widthForUnbrokenRun() that can take advantages of the word cache in CachingWordShaper for arbitrary length of Asian text. CachingWordShaper delimits text by spaces, so it does not split scripts that do not use spaces such as Asian scripts. The primary use of Font::width() is the line breaker, and it queries by splitting text at break opportunities. Since such Asian scripts have break opportunity between every character, the way CachingWordShaper handles "word" works good for the line breaker. The <select> element measures all text in its <option> elements to determine its width, and since each <option> is usually unique text, this characteristic of CachingWordShaper slows it down when it has many <option> elements. A benchmark of 2352 option elements with CJK text was slower than ASCII by 6-7 times. This patch improves it to 20-30% slower. BUG=565902

Patch Set 1 : Fix LayoutMenuList only #

Patch Set 2 : Typo and minor edits #

Patch Set 3 : Strategy changed to fix all code paths #

Patch Set 4 : Fix unsigned and add test #

Patch Set 5 : Revert to PS2 #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+41 lines, -1 line) Patch
M third_party/WebKit/Source/core/layout/LayoutMenuList.cpp View 3 4 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/platform/fonts/Font.h View 3 4 1 chunk +1 line, -0 lines 1 comment Download
M third_party/WebKit/Source/platform/fonts/Font.cpp View 1 2 3 4 1 chunk +39 lines, -0 lines 0 comments Download

Messages

Total messages: 18 (12 generated)
kojii
This patch is very local to LayoutMenuList, a bit hacky. Not sure whether we should ...
5 years ago (2015-12-16 12:59:39 UTC) #13
drott
https://codereview.chromium.org/1525963002/diff/100001/third_party/WebKit/Source/platform/fonts/Font.h File third_party/WebKit/Source/platform/fonts/Font.h (right): https://codereview.chromium.org/1525963002/diff/100001/third_party/WebKit/Source/platform/fonts/Font.h#newcode87 third_party/WebKit/Source/platform/fonts/Font.h:87: float widthForUnbrokenRun(const TextRun&) const; This method and its implementation, ...
5 years ago (2015-12-16 13:17:39 UTC) #14
kojii
On 2015/12/16 at 13:17:39, drott wrote: > https://codereview.chromium.org/1525963002/diff/100001/third_party/WebKit/Source/platform/fonts/Font.h > File third_party/WebKit/Source/platform/fonts/Font.h (right): > > https://codereview.chromium.org/1525963002/diff/100001/third_party/WebKit/Source/platform/fonts/Font.h#newcode87 ...
5 years ago (2015-12-16 13:22:40 UTC) #15
kojii
Just to make sure the intention is understood; this CL is probably not necessary if ...
5 years ago (2015-12-16 13:30:13 UTC) #16
drott
> Option 1 looks reasonable to me, WDYT? I prefer 2) and 3) - additional ...
5 years ago (2015-12-16 14:30:45 UTC) #17
kojii
5 years ago (2015-12-16 17:37:30 UTC) #18
On 2015/12/16 at 14:30:45, drott wrote:
> > Option 1 looks reasonable to me, WDYT?
> 
> I prefer 2) and 3) - additional splitting should be done in CachingWordShaper.

Ok, thank you for your thoughts. Let's try to fix this all.

Powered by Google App Engine
This is Rietveld 408576698