Skip to content

perf: simplify JSON Date/Instant serialization DHIS2-20274#22896

Draft
teleivo wants to merge 1 commit intomasterfrom
DHIS2-20274
Draft

perf: simplify JSON Date/Instant serialization DHIS2-20274#22896
teleivo wants to merge 1 commit intomasterfrom
DHIS2-20274

Conversation

@teleivo
Copy link
Contributor

@teleivo teleivo commented Feb 2, 2026

  • Replace Joda-Time based date formatting with java.time.DateTimeFormatter
  • Avoid intermediate Joda DateTime conversions in WriteDateStdSerializer and WriteInstantStdSerializer
  • Cache the DateTimeFormatter instance in each serializer for reuse (thread-safe)

This optimization addresses date serialization showing up in CPU profiles.

Replace Joda-Time based date formatting with java.time.DateTimeFormatter
for improved performance. The serializers now:

- Use DateTimeFormatter directly instead of going through DateUtils
- Avoid intermediate Joda DateTime conversions
- Cache the formatter instance for reuse
@sonarqubecloud
Copy link

sonarqubecloud bot commented Feb 2, 2026

Quality Gate Failed Quality Gate failed

Failed conditions
1 New issue
1 New Code Smells (required ≤ 0)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments