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

Issue 18949006: Optimize Font CodePath selection and more unit testing. (Closed)

Created:
7 years, 5 months ago by Stephen Chennney
Modified:
7 years, 5 months ago
CC:
blink-reviews, jamesr, eae+blinkwatch, danakj, dglazkov+blink, Rik, jeez, pdr., abarth-chromium
Visibility:
Public.

Description

Optimize Font CodePath selection and more unit testing. Replaces the long sequences of if statements in Font::characterRangeCodePath, Font::isCJKIdeograph and Font::isCJKIdeographOrSymbol with a hash set and/or binary tree lookup (with a little bit of early out and surrogate glyph testing). Also here is additional unit testing for these font code path checks. Perf tests show no regression and no speedup, although we are unlikely to have much perf coverage of these glyphs, if any. I don't see how we could possible be slower for most cases, and we would only be slower in complex cases if the glyphs happen to hit one of the early if tests. Note that in the old code, Font::isCJKIdeograph and Font::isCJKIdeographOrSymbol went through every if statement before returning false, despite the fact that the bulk of common glyphs could be trivially rejected as being lower than any of the ranges. There is an obvious error at the very end of Font::isCJKIdeographOrSymbol which is fixed in this patch. R=eseidel@chromium.org BUG=251328 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=154838

Patch Set 1 #

Patch Set 2 : Remove extraneous code. #

Patch Set 3 : Fix Windows compile. Simpler too. #

Patch Set 4 : Fix test check macros. #

Total comments: 1

Patch Set 5 : Fixed tests and rest of optimization #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+528 lines, -848 lines) Patch
M Source/core/platform/graphics/Font.cpp View 1 2 3 4 3 chunks +261 lines, -303 lines 4 comments Download
M Source/core/platform/graphics/FontTest.cpp View 1 2 3 4 2 chunks +267 lines, -545 lines 0 comments Download

Messages

Total messages: 21 (0 generated)
Stephen Chennney
7 years, 5 months ago (2013-07-11 19:10:48 UTC) #1
Stephen Chennney
On 2013/07/11 19:10:48, Stephen Chenney wrote: New patch pending to fix Windows compile error.
7 years, 5 months ago (2013-07-11 19:29:41 UTC) #2
Stephen Chennney
Eric, you might like where this is going.
7 years, 5 months ago (2013-07-12 15:39:49 UTC) #3
eseidel
I find the unittests insanity-verbose. :) I do support better testing however. Do we have ...
7 years, 5 months ago (2013-07-12 22:32:28 UTC) #4
Stephen Chennney
I really must have been sleep deprived when I wrote those tests. Here's the sane ...
7 years, 5 months ago (2013-07-15 21:32:32 UTC) #5
Stephen Chennney
On 2013/07/15 21:32:32, Stephen Chenney wrote: > I really must have been sleep deprived when ...
7 years, 5 months ago (2013-07-23 20:23:24 UTC) #6
eseidel
omg, so much better. It looks like LiteralSEt never landed, sadly: https://codereview.chromium.org/15622005/ https://codereview.chromium.org/18949006/diff/15001/Source/core/platform/graphics/Font.cpp File Source/core/platform/graphics/Font.cpp ...
7 years, 5 months ago (2013-07-23 20:49:16 UTC) #7
eseidel
https://codereview.chromium.org/18949006/diff/15001/Source/core/platform/graphics/Font.cpp File Source/core/platform/graphics/Font.cpp (right): https://codereview.chromium.org/18949006/diff/15001/Source/core/platform/graphics/Font.cpp#newcode659 Source/core/platform/graphics/Font.cpp:659: UChar32* boundingCharacter = approximateBinarySearch<UChar32, UChar32>( You mentioned you fixed ...
7 years, 5 months ago (2013-07-23 20:50:51 UTC) #8
Stephen Chennney
7 years, 5 months ago (2013-07-23 21:15:56 UTC) #9
Stephen Chennney
On 2013/07/23 20:49:16, eseidel wrote: > omg, so much better. > > It looks like ...
7 years, 5 months ago (2013-07-23 21:16:41 UTC) #10
Stephen Chennney
On 2013/07/23 20:50:51, eseidel wrote: > https://codereview.chromium.org/18949006/diff/15001/Source/core/platform/graphics/Font.cpp > File Source/core/platform/graphics/Font.cpp (right): > > https://codereview.chromium.org/18949006/diff/15001/Source/core/platform/graphics/Font.cpp#newcode659 > ...
7 years, 5 months ago (2013-07-23 21:20:57 UTC) #11
eseidel
lgtm I'm mostly trusting that you've stared at this code much more than I have ...
7 years, 5 months ago (2013-07-23 21:37:36 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/schenney@chromium.org/18949006/15001
7 years, 5 months ago (2013-07-23 21:38:21 UTC) #13
commit-bot: I haz the power
Failed to apply patch for Source/core/platform/graphics/Font.cpp: While running patch -p1 --forward --force --no-backup-if-mismatch; patching file ...
7 years, 5 months ago (2013-07-23 21:38:23 UTC) #14
eseidel
7 years, 5 months ago (2013-07-23 21:38:43 UTC) #15
glenn
On 2013/07/11 19:10:48, Stephen Chenney wrote: I suspect you could get a much better performance ...
7 years, 5 months ago (2013-07-24 15:49:58 UTC) #16
Stephen Chennney
Committed patchset #5 manually as r154838 (presubmit successful).
7 years, 5 months ago (2013-07-24 17:50:57 UTC) #17
abarth-chromium
https://codereview.chromium.org/18949006/diff/15001/Source/core/platform/graphics/Font.cpp File Source/core/platform/graphics/Font.cpp (right): https://codereview.chromium.org/18949006/diff/15001/Source/core/platform/graphics/Font.cpp#newcode612 Source/core/platform/graphics/Font.cpp:612: cjkIsolatedSymbols->add(0x1F100); This is likely to blow up the binary. ...
7 years, 5 months ago (2013-07-24 22:34:24 UTC) #18
Stephen Chennney
https://codereview.chromium.org/18949006/diff/15001/Source/core/platform/graphics/Font.cpp File Source/core/platform/graphics/Font.cpp (right): https://codereview.chromium.org/18949006/diff/15001/Source/core/platform/graphics/Font.cpp#newcode612 Source/core/platform/graphics/Font.cpp:612: cjkIsolatedSymbols->add(0x1F100); On 2013/07/24 22:34:24, abarth wrote: > This is ...
7 years, 5 months ago (2013-07-24 23:02:18 UTC) #19
abarth-chromium
Yep!
7 years, 5 months ago (2013-07-24 23:10:35 UTC) #20
Stephen Chennney
7 years, 5 months ago (2013-07-24 23:22:50 UTC) #21
Message was sent while issue was closed.
On 2013/07/24 23:10:35, abarth wrote:
> Yep!

OK. Tomorrow's TODO.

Powered by Google App Engine
This is Rietveld 408576698