Skip to content

Performance issue in DefaultFieldSet due to the usage of SimpleDateFormat #1694

Closed
@spring-projects-issues

Description

@spring-projects-issues

Brian Tarbox opened BATCH-1902 and commented

DefaultFieldSet creates a SimpleDateFormat (SDF) object as a member variable. This means it can not be overridden. SDF eventually calls TimeZone which calls getDefaultInAppContext. This is a static, synchronized and very slow method. This results in extremely slow reads.

To fix the problem in my own code means I have to basically make a copy of the entire DefaultFieldSet class. If the SDF were injected then I could change the slow behavior without having to copy the whole class.

I spoke with Gary Gregory (Spring Batch In Action) and he liked the idea of this change.


Affects: 2.1.8

Reference URL: http://stackoverflow.com/questions/12984345/java-7-calendar-getinstance-timezone-gettimezone-got-synchronized-and-slow-any

0 votes, 5 watchers

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions