restlet-framework-java icon indicating copy to clipboard operation
restlet-framework-java copied to clipboard

Android 2.3.5: bad performance due to date formatting in DateUtil

Open bjking2 opened this issue 8 years ago • 2 comments

 if (FORMAT_RFC_3339.get(0).equals(format)) {
    formatter = new InternetDateFormat(TIMEZONE_GMT);
} else {
    formatter = new java.text.SimpleDateFormat(format, java.util.Locale.US);
    formatter.setTimeZone(TIMEZONE_GMT);
}

The line "SimpleDateFormat" causes a really bad performance android devices: 01-04 18:56:05.550 15660-17358/com.XXXXX W/System.err: Loaded time zone names for en_US in 858ms.

On old devices it may take even longer.

Possible solutions to fix this issue are discusses in: http://stackoverflow.com/questions/3905545/android-load-timezone-too-long-loaded-time-zone-names-for-en-us

bjking2 avatar Jan 04 '16 18:01 bjking2