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

Separate *args from **kwargs #32

Merged
merged 1 commit into from
Sep 23, 2020
Merged

Separate *args from **kwargs #32

merged 1 commit into from
Sep 23, 2020

Conversation

jemmaissroff
Copy link
Contributor

@jemmaissroff jemmaissroff commented Sep 8, 2020

This commit separates *args from **kwargs in the memo_wise'd
method signatures, and only uses the minimum necessary. This
allows us to gain performance benefits (fewer allocations in
many cases) and silence the Ruby warnings.

Before merging:

  • Copy the latest benchmark results into the README.md and update this PR
  • Rebase PR into one coherent commit

@JacobEvelyn
Copy link
Member

@jemmaissroff I hope I didn't step on your toes in finishing this out—I think when we last left off we said I'd update the benchmarks in the README but to do that I realized I needed to add a few more benchmarks and then it was easy to just also add the RSpec tests as well.

This is ready for review!

Copy link
Contributor Author

@jemmaissroff jemmaissroff left a comment

Choose a reason for hiding this comment

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

Code lgtm. Only question is if we're planning on filling in the benchmarks in this PR or another one?

@@ -70,6 +70,26 @@ def keyword_args(a:, b:)
100
end
#{benchmark_gem.memoization_method} :keyword_args

def positional_and_keyword_args(a, b:)
100
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do we have an issue to fill these in?

Copy link
Member

Choose a reason for hiding this comment

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

What would we fill these in with? I don't think the result would impact the benchmark since we're only benchmarking cache value returns, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah yup you're totally right, PR lgtm. Can merge this if you approve!

Also, looks like I lost permission to push to this repo. Any chance you could check on that?

Copy link
Member

Choose a reason for hiding this comment

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

Whoops, sorry! Should be fixed now!

This commit separates *args from **kwargs in the memo_wise'd
method signatures, and only uses the minimum necessary. This
allows us to gain performance benefits (fewer allocations in
many cases) and silence the Ruby warnings.
@JacobEvelyn JacobEvelyn force-pushed the silencing-args-warning branch from c593c36 to c546911 Compare September 23, 2020 19:14
@JacobEvelyn JacobEvelyn changed the title WIP: Silencing args warning Separate *args from **kwargs Sep 23, 2020
@jemmaissroff jemmaissroff merged commit 0b73c53 into main Sep 23, 2020
@jemmaissroff jemmaissroff deleted the silencing-args-warning branch September 23, 2020 19:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants