-
Notifications
You must be signed in to change notification settings - Fork 21
Migrate Duration to smallest numeric types possible for efficiency #366
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
Open
robot-head
wants to merge
32
commits into
boa-dev:main
Choose a base branch
from
robot-head:ms/optimize_duration
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
e88e66e
Use bnum to define an InternalDuration struct
robot-head 93f5315
Finish addressing all implications
robot-head ece5d8f
Merge branch 'main' into ms/optimize_duration
robot-head c546ae3
Remove TimeDuration completely
robot-head 9c4b638
Merge branch 'ms/optimize_duration' of https://github.com/robot-head/…
robot-head 22a2d41
Fix compile error
robot-head 5cfb206
Fix lint
robot-head 87c8513
Fix tests
robot-head 21db4f5
Fix tests and lint errors
robot-head 45d3262
Fix depcheck
robot-head a2e677a
cargo run -p diplomat-gen
robot-head 9d46a14
Fix sign calculations
robot-head cbd388e
Fix compile error
robot-head 0f67ff8
Fix duration sign handling and time diff
robot-head 1a78f43
Merge pull request #6 from robot-head/codex/fix-failing-tests
robot-head f22a1d1
Fix duration sign handling
robot-head 25ed765
Fix lint
robot-head 6b9b646
Merge pull request #7 from robot-head/6o0p22-codex/fix-failing-tests
robot-head 7123b03
Fix lint
robot-head 79cdb11
Fix duration calc
robot-head 9fd53fe
Respond to comments
robot-head 7aa9d0f
Merge remote-tracking branch 'origin/main' into ms/optimize_duration
robot-head c0eecb0
Post-merge fixes
robot-head 74442e4
Fix sign on NormalizedDurationRecord
robot-head 12abb62
Fix nudge_to_day_or_time
robot-head 06e9f9d
Add from_components method to NormalizedTimeDuration for creating ins…
ee85fa0
Refactor U48 type definition to use BUintD16
ef1f029
Refactor Duration constructor to use absolute values for time components
4ee26b4
Merge branch 'main' into ms/optimize_duration
nekevss 0e72c84
Fix broken tests + update various abstract operations
nekevss 3d14622
Update the FFI
nekevss 7895f65
Update tzif-inspect + add test case to from_partial_duration
nekevss 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 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
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
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
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
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
Oops, something went wrong.
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: hmm, I know this was @nekevss's suggestion, but I'm not really excited about adding a new dependency just for an optimization, especially one we haven't measured the benefit of)
suggestion: Can we implement one of the earlier suggestions to use narrow stdlib integer types and flatten Duration, and then have a separate discussion for adding the
bnum
dependency? I imagine that switchover will be cleaner.@nekevss opinions?
(Given that this is reviewed already, I wouldn't recommend changing the PR until we decide what we want here, it's possible temporal_rs decides to take on the bnum dep)
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.
Honestly, the one thing I've been most iffy about is adding the extra dependency (to the point of debating looking up how to manually implement arbitrarily sized integers 😅)
Hmmmmmm, I can flatten the struct and do some of the specification updates in a separate PR. If I realized that was going to be such a big portion of this PR, then I would've wanted that split off in a different PR anyways. My general concern is that the resulting Duration type is going to be huge.
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.
For a stack type, huge isn't really a big deal most of the time.
For JS implementors it will likely be heap allocated. But it's not like people are making thousands of these, I think.