Optimize formatting a bit#1558
Merged
Merged
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1558 +/- ##
==========================================
+ Coverage 91.78% 91.80% +0.02%
==========================================
Files 37 37
Lines 18167 18148 -19
==========================================
- Hits 16674 16661 -13
+ Misses 1493 1487 -6 ☔ View full report in Codecov by Sentry. |
Collaborator
Author
|
Thank you 😄. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This takes the commits from #1163 that simplify and optimize our formatting code a bit. #1335 took the initial refactor from that PR, so now we can take the more interesting part.
Two commits make better use of
matchto only accept a formatting item if we also have the date/time/offset fields it needs, instead of usingmapinside a match arm.The last commit introduces a couple of optimized number formatting functions. They are the trick that makes our formatting implementations for RFC 2822 and 3339 faster, so lets use them for regular formatting too 😄.
Benchmarks