Skip to content
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

Add support for pattern bindings in function arguments and perf improvements #195

Merged
merged 4 commits into from
Dec 4, 2020

Conversation

udoprog
Copy link
Collaborator

@udoprog udoprog commented Dec 4, 2020

You can now use panicking pattern bindings in functions and closures:

fn foo((a, b): #{c, d}) {
    (a + b) / (c + d)
}

pub fn main() {
    let a = (3, 1);
    let b = #{c: 1, d: 7};
    foo(a, b)
}

Also added a few performance improvements leading to this result:
image

The big points are:

  • More variable folding leading to less copies (all though return of investment of this is lower)
  • A dedicated instruction for advancing iteration (5aa6d77).

@udoprog udoprog added performance enhancement New feature or request labels Dec 4, 2020
@udoprog udoprog merged commit cef6622 into main Dec 4, 2020
@udoprog udoprog deleted the opt-passes branch December 4, 2020 08:18
@udoprog udoprog added the changelog Issue has been added to the changelog label Jan 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog Issue has been added to the changelog enhancement New feature or request performance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant