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

Issue 349223003: Optimize SVGTextQuery's character offset ligature adjustment query (Closed)

Created:
6 years, 6 months ago by fs
Modified:
6 years, 6 months ago
Reviewers:
pdr.
CC:
blink-reviews, blink-reviews-rendering, zoltan1, eae+blinkwatch, leviw+renderwatch, kouhei+svg_chromium.org, fs, ed+blinkwatch_opera.com, krit, f(malita), gyuyoung.kim_webkit.org, jchaffraix+rendering, rwlbuis, Stephen Chennney, rune+blink
Project:
blink
Visibility:
Public.

Description

Optimize SVGTextQuery's character offset ligature adjustment query For queries that take a code unit to compute some property for (basically all *OfChar calls), the <start, end> range is mapped to the closest glyph-boundary to allow queries within ligatures. This adjustment step is O(N), N=number of glyphs within a text node, and is performed for each fragment within a text box. This means that for text boxes with a large number of fragments - and, consequently, a large number of glyphs - there'll be O(N^2) behavior. Since the <start, end> range is invariant for most queries, it should suffice to compute the adjusted range once per text node [1]. The easiest way to achieve this is by adding a simple cache and reuse the result of an adjustment query (for every fragment in a text box.) This improves the runtime of the test in the bug from ~13s to ~120ms (or approximately a factor 100) locally. [1] This CL however only perform caching per text box in order to minimize modifications to the actual adjustment code. BUG=267504 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=176937

Patch Set 1 #

Total comments: 6

Patch Set 2 : Fold *Cached method. #

Patch Set 3 : More explicit invalidation. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+35 lines, -8 lines) Patch
M Source/core/rendering/svg/SVGTextQuery.cpp View 1 2 4 chunks +35 lines, -8 lines 0 comments Download

Messages

Total messages: 7 (0 generated)
fs
(The getCharNumAtPosition() code-path is still appalling, and isn't helped by this cache at all. It's ...
6 years, 6 months ago (2014-06-23 14:42:12 UTC) #1
pdr.
https://codereview.chromium.org/349223003/diff/1/Source/core/rendering/svg/SVGTextQuery.cpp File Source/core/rendering/svg/SVGTextQuery.cpp (right): https://codereview.chromium.org/349223003/diff/1/Source/core/rendering/svg/SVGTextQuery.cpp#newcode57 Source/core/rendering/svg/SVGTextQuery.cpp:57: // Invalidate the ligature-adjustment cache. Is it possible to ...
6 years, 6 months ago (2014-06-24 21:18:48 UTC) #2
fs
https://codereview.chromium.org/349223003/diff/1/Source/core/rendering/svg/SVGTextQuery.cpp File Source/core/rendering/svg/SVGTextQuery.cpp (right): https://codereview.chromium.org/349223003/diff/1/Source/core/rendering/svg/SVGTextQuery.cpp#newcode57 Source/core/rendering/svg/SVGTextQuery.cpp:57: // Invalidate the ligature-adjustment cache. On 2014/06/24 21:18:48, pdr ...
6 years, 6 months ago (2014-06-25 10:29:50 UTC) #3
pdr.
On 2014/06/25 10:29:50, fs wrote: > https://codereview.chromium.org/349223003/diff/1/Source/core/rendering/svg/SVGTextQuery.cpp > File Source/core/rendering/svg/SVGTextQuery.cpp (right): > > https://codereview.chromium.org/349223003/diff/1/Source/core/rendering/svg/SVGTextQuery.cpp#newcode57 > ...
6 years, 6 months ago (2014-06-25 16:05:09 UTC) #4
fs
The CQ bit was checked by fs@opera.com
6 years, 6 months ago (2014-06-25 17:06:14 UTC) #5
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/fs@opera.com/349223003/40001
6 years, 6 months ago (2014-06-25 17:06:27 UTC) #6
commit-bot: I haz the power
6 years, 6 months ago (2014-06-25 17:09:11 UTC) #7
Message was sent while issue was closed.
Change committed as 176937

Powered by Google App Engine
This is Rietveld 408576698