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 a merge method for Pairs of NamedTuple to speed up keyword splatting #25936

Merged
merged 1 commit into from
Feb 8, 2018

Conversation

JeffBezanson
Copy link
Member

Fixes #9551. Well, that was also fixed by #24795, but this re-fixes it.

@JeffBezanson JeffBezanson added performance Must go faster keyword arguments f(x; keyword=arguments) labels Feb 7, 2018
@@ -226,6 +226,8 @@ end

merge(a::NamedTuple{()}, b::NamedTuple) = b

merge(a::NamedTuple, b::Iterators.Pairs{<:Any,<:Any,<:Any,<:NamedTuple}) = merge(a, b.data)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have an existing test that hits this code path?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this is covered by the keywordargs tests.

@JeffBezanson JeffBezanson merged commit b85d5a1 into master Feb 8, 2018
@JeffBezanson JeffBezanson deleted the jb/fasterkwsplat branch February 8, 2018 04:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
keyword arguments f(x; keyword=arguments) performance Must go faster
Projects
None yet
Development

Successfully merging this pull request may close these issues.

keyword arguments are very slow
2 participants