C
Christopher Dean
Does anyone know what are the performance tradeoffs between
synchronizing on static SimpleDateFormat objects (since they are not
thread-safe) vs. creating a static SimpleDateFormat instance and cloning
it every time it needs to be used. I use static instances so the
pattern can be compiled once because this takes time. My gut tells me
the synchronization overhead is greater than the clone but I am not sure
(and don't have a good profiler) so if anyone has any insight....
synchronizing on static SimpleDateFormat objects (since they are not
thread-safe) vs. creating a static SimpleDateFormat instance and cloning
it every time it needs to be used. I use static instances so the
pattern can be compiled once because this takes time. My gut tells me
the synchronization overhead is greater than the clone but I am not sure
(and don't have a good profiler) so if anyone has any insight....