Skip to content

try to avoid reparsing numbers as BigDecimal when serializing#1073

Closed
pjfanning wants to merge 1 commit intoplayframework:mainfrom
pjfanning:decimal-serialization-perf
Closed

try to avoid reparsing numbers as BigDecimal when serializing#1073
pjfanning wants to merge 1 commit intoplayframework:mainfrom
pjfanning:decimal-serialization-perf

Conversation

@pjfanning
Copy link
Contributor

@pjfanning pjfanning commented Sep 5, 2024

Pull Request Checklist

  • Have you read through the contributor guidelines?
  • Have you squashed your commits?
  • Have you added copyright headers to new files?
  • Have you updated the documentation?
  • Have you added tests for any changed functionality?

Fixes

Fixes #xxxx

Purpose

What does this PR do?

Parsing numbers from strings is expensive. This PR covers one case where a BigDecimal is converted to a String (expensive too) and then parsed again as a BigDecimal. This PR skips the final parse and just uses the BigDecimal instance that we already have.

Background Context

Why did you take this approach?

References

Are there any relevant issues / PRs / mailing lists discussions?

@pjfanning pjfanning marked this pull request as draft September 5, 2024 02:10
@pjfanning pjfanning marked this pull request as ready for review September 5, 2024 02:20
@pjfanning pjfanning marked this pull request as draft September 5, 2024 03:27
@pjfanning pjfanning closed this Sep 12, 2024
@pjfanning pjfanning deleted the decimal-serialization-perf branch January 12, 2025 20:36
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