-
Notifications
You must be signed in to change notification settings - Fork 176
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DurationFormatter: Remove allocations #5383
Merged
younies
merged 30 commits into
unicode-org:main
from
kartva:duration-formatter-remove-allocation
Aug 21, 2024
Merged
Changes from all commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
089de2f
add separate hms, hm and ms padding structs
kartva c26347d
numeric formatting functions
kartva b66b7d9
add fractional truncation to format numeric second
kartva 9dc37bb
add divergence note for twoDigitHours
kartva c959236
DurationFormatter constructor and digital test
kartva 6cb98f9
fix fractionaldigit truncation
kartva 447ceec
fmt
kartva 810a2a5
add listformat
kartva cb5ab0c
Merge branch 'main' into duration-formatter-impl
kartva 74e038a
DurationSign->fixedDecimal::Sign map Positive to None sign
kartva edce2ae
fix: incorrect hour digital default
kartva 5b4e69f
add durationformatter tests
kartva ba27195
add compiled_data annotation to DurationUnitFormatter::try_new
kartva 08483b9
change literal category
kartva 6925942
remove references to partsink
kartva 486ba11
Merge branch 'main' into duration-formatter-impl
kartva 39cf59f
remove allocations from DurationFormatter
kartva c7b748c
tidy: grammar
kartva 72bf6e5
Merge branch 'main' into duration-formatter-remove-allocation
kartva 9ebe737
fix line duplication from merge
kartva 6fdd0e5
fmt: format.rs: fix license header
kartva 2311797
deps: add arrayvec to allowlist
kartva bf49a67
deps: remove arrayvec implicit std feature
kartva b0a7501
deps: move arrayvec to external dep group 1
kartva a16a7d0
deps: resolve icu_list/serde duplication
kartva d1eab88
deps: switch from arrayvec to smallvec
kartva 42f2aa1
deps: enable const-generics feature for smallvec
kartva c351054
Merge branch 'main' into duration-formatter-remove-allocation
younies 01a3642
tidy: rename DigitalDurationFormat -> DigitalDuration
kartva b18df4a
doc: add comment to test_duration_formatter
kartva File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
This file contains 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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
issue: we already have
smallvec
in this list, can you use that?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think
arrayvec
is slightly better thansmallvec
in this instance because there is a known, small upper limit to the length of the vector.smallvec
has code and branching to overflow to the heap, which we don't need here.arrayvec
is in Cargo.lock so it's not a new dependency.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not currently a runtime dep: https://github.com/unicode-org/icu4x/blob/main/tools/make/depcheck/src/allowlist.rs#L41
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True. Flagging @Manishearth for the new runtime dependency.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we're adding another crate on top of
smallvec
, I think it should beheapless
, which has more features thanarrayvec
. I'm not convinced this is worth adding another crate though.