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

Streamlined ABI encoder logic for returning tuple types #2302

Merged
merged 2 commits into from
Feb 16, 2021

Conversation

iamdefinitelyahuman
Copy link
Contributor

What I did

Simplify the logic around returning tuples, when each member of the tuple is of the same type.

How I did it

Add a special if branch that replicates the logic for returning an array type. This branch is only reached if every member of the tuple has the same type, and that type is a base type (or array of the base type).

This has a not-insignificant effect on the bytecode size.

How to verify it

Run tests (TODO)

Cute Animal Picture

Cute aminals are for closers.

@codecov-io
Copy link

codecov-io commented Feb 15, 2021

Codecov Report

Merging #2302 (0605abb) into master (27e8e66) will decrease coverage by 0.03%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2302      +/-   ##
==========================================
- Coverage   85.84%   85.81%   -0.04%     
==========================================
  Files          85       85              
  Lines        8539     8556      +17     
  Branches     2034     2040       +6     
==========================================
+ Hits         7330     7342      +12     
- Misses        727      730       +3     
- Partials      482      484       +2     
Impacted Files Coverage Δ
vyper/codegen/return_.py 100.00% <100.00%> (ø)
vyper/functions/functions.py 89.25% <0.00%> (-0.57%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 27e8e66...0605abb. Read the comment docs.

Copy link
Member

@fubuloubu fubuloubu left a comment

Choose a reason for hiding this comment

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

Add a few tests

@iamdefinitelyahuman iamdefinitelyahuman marked this pull request as ready for review February 15, 2021 23:58
@fubuloubu fubuloubu merged commit b378bfd into vyperlang:master Feb 16, 2021
@iamdefinitelyahuman iamdefinitelyahuman deleted the optimize-tuple-return branch February 16, 2021 10:28
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.

3 participants