diff options
author | Tao Bao <tbao@google.com> | 2015-02-06 15:03:01 -0800 |
---|---|---|
committer | Tao Bao <tbao@google.com> | 2015-02-11 10:22:32 -0800 |
commit | 7bcff480531c1aa18de118c6f36dd397d5e1ad86 (patch) | |
tree | 669efcffdeaf3df1873c9672f2f6fa62ffc625c1 /dom | |
parent | a9c24ad83f3cd18738268559169ba901b5f70232 (diff) | |
download | libcore-7bcff480531c1aa18de118c6f36dd397d5e1ad86.zip libcore-7bcff480531c1aa18de118c6f36dd397d5e1ad86.tar.gz libcore-7bcff480531c1aa18de118c6f36dd397d5e1ad86.tar.bz2 |
Use ICU for relative time formatting
Rewrite the DateUtils' relative time formatting APIs
(getRelativeTimeSpanString, getRelativeDateTimeString) to use ICU ones.
Two APIs that take withPreposition parameter are not changed. Because
(a) ICU doesn't provide functionality to format preposition; (b) They
are not really computing relative time but instead calling
formatDateRange() to get the absolute time/date string.
Benchmark results on aosp_hammerhead-userdebug:
before:
benchmark us linear runtime
DateUtils_getRelativeDateTimeString 127.1 ==========================
DateUtils_getRelativeDateTimeString_ABBREV 145.0 ==============================
DateUtils_getRelativeTimeSpanString 28.0 =====
DateUtils_getRelativeTimeSpanString_ABBREV 27.9 =====
now:
benchmark us linear runtime
RelativeDateTimeFormatter_getRelativeDateTimeString 119.2 ==========================
RelativeDateTimeFormatter_getRelativeDateTimeString_ABBREV 133.8 ==============================
RelativeDateTimeFormatter_getRelativeTimeSpanString 24.6 =====
RelativeDateTimeFormatter_getRelativeTimeSpanString_ABBREV 24.7 =====
Bug: 19146457
Bug: 5252772
Change-Id: Ief74608354964a17e42191d7b1a58964f3a9acfd
Diffstat (limited to 'dom')
0 files changed, 0 insertions, 0 deletions