[SDK Optimization] Multiple SimpleDateFormat initialization in CarbonReader
- Dominant language
- Scala
- Stars
- 1.5k
- Forks
- 694
- PR merge metrics
- No merged PRs in 30d
Description
I found that reading carbon files from CarbonReader takes long time in "SimpleDateFormat.", see attached file for output of
profiling.
https://github.com/apache/carbondata/blob/4b8846d1e6737e7db8a96014818c067c8c253d1f/sdk/sdk/src/main/java/org/apache/carbondata/sdk/file/CarbonReader.java#L207
I wonder if it is OK if we add some lazy initialization to SimpleDateFormat in the class, and if so should it support multi-threading.
[profile.zip](https://github.com/apache/carbondata/files/8954954/profile.zip)
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with sdk/sdk/src/main/java/org/apache/carbondata/sdk/file/CarbonReader.java around line 207 and review the attached profile.zip to confirm the repeated SimpleDateFormat initialization cost. Determine whether lazy initialization is appropriate and how the change should behave with multiple threads. Done means reducing unnecessary initialization without introducing thread-safety problems.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- performance
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100