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

Issue 2379033004: Optimize some code in RenderTextHarfbuzz. (Closed)

Created:
4 years, 2 months ago by Alexei Svitkine (slow)
Modified:
4 years, 2 months ago
Reviewers:
msw
CC:
chromium-reviews, derat+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Optimize some code in RenderTextHarfbuzz. This was showing up in the UMA callstacks profiler as taking significant time on start up. Turns out, creating and Init'ing the BreakIterator does some icu initialization which is expensive, e.g. ~50ms at the mean from dev UMA users. However, we only ever need the BreakIterator if there's a grapheme run of over 2 characters - which might be uncommon for many users. So this change makes that initialization lazy - only done when we actually need it. BUG=651848 Committed: https://crrev.com/49cf5df2724445f3160b4fdf13a187295abe14fb Cr-Commit-Position: refs/heads/master@{#422564}

Patch Set 1 : . #

Total comments: 6

Patch Set 2 : Nits & git cl format #

Unified diffs Side-by-side diffs Delta from patch set Stats (+35 lines, -43 lines) Patch
M ui/gfx/render_text_harfbuzz.h View 1 4 chunks +5 lines, -5 lines 0 comments Download
M ui/gfx/render_text_harfbuzz.cc View 1 6 chunks +21 lines, -20 lines 0 comments Download
M ui/gfx/render_text_unittest.cc View 1 5 chunks +9 lines, -18 lines 0 comments Download

Messages

Total messages: 20 (13 generated)
Alexei Svitkine (slow)
4 years, 2 months ago (2016-09-30 18:29:51 UTC) #5
Alexei Svitkine (slow)
Example data showing this taking ~50ms mean on startup: https://uma.googleplex.com/callstacks?sid=2cdebb69b518e116060e39850c14e38f
4 years, 2 months ago (2016-09-30 18:31:42 UTC) #7
msw
lgtm with nits; thanks! https://codereview.chromium.org/2379033004/diff/20001/ui/gfx/render_text_harfbuzz.cc File ui/gfx/render_text_harfbuzz.cc (right): https://codereview.chromium.org/2379033004/diff/20001/ui/gfx/render_text_harfbuzz.cc#newcode649 ui/gfx/render_text_harfbuzz.cc:649: RenderTextHarfBuzz* render_text, nit: fits on ...
4 years, 2 months ago (2016-09-30 19:10:18 UTC) #8
Alexei Svitkine (slow)
Thanks! https://codereview.chromium.org/2379033004/diff/20001/ui/gfx/render_text_harfbuzz.cc File ui/gfx/render_text_harfbuzz.cc (right): https://codereview.chromium.org/2379033004/diff/20001/ui/gfx/render_text_harfbuzz.cc#newcode649 ui/gfx/render_text_harfbuzz.cc:649: RenderTextHarfBuzz* render_text, On 2016/09/30 19:10:17, msw wrote: > ...
4 years, 2 months ago (2016-09-30 19:14:17 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2379033004/40001
4 years, 2 months ago (2016-10-03 21:09:20 UTC) #16
commit-bot: I haz the power
Committed patchset #2 (id:40001)
4 years, 2 months ago (2016-10-03 22:25:36 UTC) #18
commit-bot: I haz the power
4 years, 2 months ago (2016-10-03 22:27:54 UTC) #20
Message was sent while issue was closed.
Patchset 2 (id:??) landed as
https://crrev.com/49cf5df2724445f3160b4fdf13a187295abe14fb
Cr-Commit-Position: refs/heads/master@{#422564}

Powered by Google App Engine
This is Rietveld 408576698