Chromium Code Reviews
Help | Chromium Project | Gerrit Changes | Sign in
(13)

Issue 1188663005: Speed-up font switching in CanvasRenderingContext2D by only validating uncached values (Closed)

Created:
4 years, 10 months ago by Justin Novosad
Modified:
4 years, 10 months ago
Reviewers:
Stephen White
CC:
blink-reviews, dshwang, blink-reviews-html_chromium.org, dglazkov+blink, Rik, Justin Novosad
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Target Ref:
refs/heads/master
Project:
blink
Visibility:
Public.

Description

Speed-up font switching in CanvasRenderingContext2D by only validating uncached values This change moves some expensive validation logic in CanvasRenderingContext2D::setFont to be executed only when a font style does not get a cache hit, instead of always. To make this work, we must be able to assume that all cached font strings are valid, and to make that safe, this change stops the caching of invalid font strings. So this change sacrifices a bit of the performance of invalid font strings (which should not happen in production web code anyways) to get a >20% perf boost on cache hits. BUG=497864 TEST=Telemetry blink_perf.canvas -> setFontAndMeasureText Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=197364

Patch Set 1 #

Patch Set 2 : moved literal "initial" into const #

Unified diffs Side-by-side diffs Delta from patch set Stats (+8 lines, -10 lines) Patch
M Source/core/html/canvas/CanvasRenderingContext2D.cpp View 1 2 chunks +8 lines, -10 lines 0 comments Download

Messages

Total messages: 6 (2 generated)
Justin Novosad
PTAL
4 years, 10 months ago (2015-06-18 13:56:10 UTC) #2
Stephen White
LGTM
4 years, 10 months ago (2015-06-18 14:24:44 UTC) #3
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1188663005/20001
4 years, 10 months ago (2015-06-18 16:06:47 UTC) #5
commit-bot: I haz the power
4 years, 10 months ago (2015-06-18 16:11:38 UTC) #6
Message was sent while issue was closed.
Committed patchset #2 (id:20001) as
https://src.chromium.org/viewvc/blink?view=rev&revision=197364

Powered by Google App Engine
This is Rietveld 408576698