DescriptionSpeed-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 #Messages
Total messages: 6 (2 generated)
|