-
Notifications
You must be signed in to change notification settings - Fork 141
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
Implement stimes more efficiently #301
Merged
Merged
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
16814f2
Adds stimes implementation to strict ByteString
elikoga 19cb622
Adds stimes to Lazy ByteString
elikoga ad587bd
Actually make Lazy stimes work
elikoga b28d8fe
Strict stimes now calls memcpy log n instead of n times
elikoga 0d2bf4f
Correct fill_from capitalization
elikoga ba78733
Throw error on non negative n in strict
elikoga 9315b15
expect positive multiplier in lazy stimes
elikoga a836c75
Make strict stimes work for n=0
elikoga cc299fa
Add n=0 case to Lazy stimes again
elikoga a866795
non-negative -> positive
elikoga b3204d7
non-negative -> positive 2
elikoga 53bd472
Add test cases for stimes
elikoga 4bac4f8
positive n for stimes precondition in tests
elikoga c3e694a
Use QuickCheck NonNegative
elikoga e95a3f1
Swap memcpy arguments
elikoga 6d3dfcd
Add semigroups to build-depends in tests
elikoga 46317fb
Only use semigroups in tests when base > 490
elikoga e3baac1
Restrict semigroup import to base>=490
elikoga 75134db
Use mempty and make more ledgible docs
elikoga 58ae410
Optimize strict times
elikoga 44490a7
Guard Lazy Empty case for greater than 0
elikoga 7ab3df5
Handle n < 0 better
elikoga 2a9ca0c
Swap guard cases
elikoga 97a66a8
Added CPP to Pragmas
elikoga 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
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
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
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.
Does returning
BS fp len
instead of a variable bound to theBS
pattern result in additional allocations?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.
Just checked with ddump-simpl and couldn't see any differences outside of different identifiers.
ddump-core-stats also returns the same amount of Terms, Types and Coercions, so I think it's optimized away. Wouldn't say no to assigning it to a name though if you believe it would be more readable
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.
The assembly generated with ddump-asm also looks essentially the same, up to renaming.
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.
Thanks for investigating! 👍