e78392830b4548c65364449441cac3ff16f955f5 |
11-Sep-2013 |
Elliott Hughes <enh@google.com> |
icu4c DateIntervalFormat objects are expensive enough that we need to cache them. It takes ~1ms to create a DateIntervalFormat on a z620, and around 8ms on a current mobile device (Nexus 4). Add a small cache of recently-used formatters, using a big lock rather than per-thread caches since this typically only happens on the UI thread anyway, and because all the other frameworks date/time formatting is behind a single lock too. Bug: 10696944 (cherry picked from commit fd1d5e92b2eaf785cb18aa295b7b846cfc5e29af) Change-Id: Iefd573ff6f9851efda0ebe18418dba61fb151e65
enchmarks/regression/DateIntervalFormatBenchmark.java
|