forked from aiken-lang/stdlib
-
Notifications
You must be signed in to change notification settings - Fork 0
V3 catchup #4
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
Merged
Merged
V3 catchup #4
Conversation
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
result -> acc
Co-authored-by: Matthias Benkort <[email protected]>
Co-authored-by: Matthias Benkort <[email protected]>
Co-authored-by: Matthias Benkort <[email protected]>
Co-authored-by: Matthias Benkort <[email protected]>
Co-authored-by: Matthias Benkort <[email protected]>
Add value.reduce into transaction/value.ak
new math function is_sqrt
Co-authored-by: Matthias Benkort <[email protected]>
That last test show that we actually can provide policy ids out of order.
Looking at Aiken's repositories in the wild, no one is using Dict with anything else than ByteArray as key. The extra complexity we bring just for making it generic in the key argument seems not worth it. Plus, if we know the key is a ByteArray, we can perform some optimizations on a few functions looking for keys to short-circuit them instead of traversing a list entirely. Here's a comparison of the mem and cpu cost before and after the chance for a few tests (omitted tests have identical cost). | mem | cpu | bench | | --- | --- | --- | | -10.15% | -5.88% | delete_3 | | -4.00% | -9.68% | delete_4 | | -3.80% | -9.39% | delete_5 | | -31.03% | -42.88% | delete_6 | | -15.26% | -26.34% | find_4 | | -11.10% | -18.85% | from_list_2 | | -8.02% | -16.26% | from_list_3 | | -12.15% | -25.39% | from_list_4 | | -19.24% | -36.11% | bench_from_list | | -17.79% | -18.91% | bench_from_ascending_list | | -4.91% | -10.58% | get_2 | | -9.49% | -14.63% | get_3 | | -29.94% | -42.75% | get_4 | | -23.66% | -37.70% | get_5 | | -7.94% | -5.03% | has_key_3 | | -9.97% | -18.50% | has_key_4 | | -16.46% | -23.61% | insert_1 | | -16.52% | -26.24% | insert_2 | | -13.82% | -22.08% | insert_with_1 | | -18.77% | -29.88% | insert_with_2 | | -19.12% | -30.52% | insert_with_3 | | -10.47% | -17.40% | keys_2 | | 4.25% | 5.06% | map_1 | | 2.94% | 3.31% | map_2 | | -10.99% | -19.83% | size_3 | | -7.94% | -16.17% | union_1 | | -17.74% | -28.17% | union_3 | | -16.96% | -26.55% | union_4 | | -15.91% | -25.10% | union_with_1 | | -10.47% | -17.39% | values_2 |
Unlike `Dict`, `Map` have no invariant and are simply mere wrapper around a list of pairs. Functions make no assumption about order of the keys and this is translated into the API which facilitate the access to underlying elements in various ways. Co-authored-by: KtorZ <[email protected]>
Specialize Dict's key to ByteArray
Add `minted_to_dict` method, just for consistency with other opaque types like Value, Dict, etc, that have methods to return inner value
Update value.ak
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.
Catching up for 1.30.0.0