summaryrefslogtreecommitdiff
path: root/tools/aapt2/java/JavaClassGenerator.cpp
diff options
context:
space:
mode:
authorSeigo Nonaka <nona@google.com>2017-12-02 19:28:05 -0800
committerSeigo Nonaka <nona@google.com>2017-12-11 18:55:12 -0800
commitfbe63bddd6ea751cb1b82f6dfb5e896f4b7a7ef4 (patch)
tree346c3fe1de1ee2fccf8d48c66cc666f34f435b60 /tools/aapt2/java/JavaClassGenerator.cpp
parent0d13717248cf34b4dfee9cd757c33ed7c57338d6 (diff)
Introduce PremeasuredText
By measuring the character widths beforehand, we can save at least 40% of the StaticLayout construction time which typically happens on UI thread. Also verified this doesn't cause performance regression for not premeasured text. Raw performance score (Not premeasured -> premeasured, median, N=100) No Style, Greedy, Hyphenation OFF: 7,812,975 -> 503,245 (-93.6%) No Style, Balanced, Hyphenation OFF: 7,843,254 -> 396,892 (-95.0%) No Style, Greedy, Hyphenation ON : 19,134,214 -> 11,658,928 (-39.1%) No Style, Balanced, Hyphenation ON : 19,348,062 -> 11,634,942 (-39.9%) Styled, Greedy, Hyphenation OFF: 14,353,673 -> 572,840 (-96.0%) Raw performance score (w/o patch -> w/ patch, median, N=100): No Style, Greedy, Hyphenation OFF: 7,732,894 -> 7,812,975 (+1.04%) No Style, Balanced, Hyphenation OFF: 7,884,510 -> 7,843,254 (-0.52%) No Style, Greedy, Hyphenation ON : 18,986,958 -> 19,134,214 (+0.78%) No Style, Balanced, Hyphenation ON : 19,232,791 -> 19,348,062 (+0.60%) Styled, Greedy, Hyphenation OFF: 14,319,690 -> 14,353,673 (+0.24%) Bug: 67504091 Test: bit CtsTextTestCases:* Test: bit CtsGraphicsTestCases:* Test: bit CtsWidgetTestCases:* Test: FrameworksCoreTests:android.text.MeasuredTextTest Change-Id: I0b46f04b42cc012606a9c722eca0d51147a0dcc7
Diffstat (limited to 'tools/aapt2/java/JavaClassGenerator.cpp')
0 files changed, 0 insertions, 0 deletions