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

Fix references to resource-kinded values #1344

Merged
merged 4 commits into from
Jan 10, 2022

Conversation

turbolent
Copy link
Member

Closes #1320

Description

Track referenced resource-kinded values and update them when another value representing the same value is transferred.


  • Targeted PR against master branch
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work
  • Code follows the standards mentioned here
  • Updated relevant documentation
  • Re-reviewed Files changed in the Github PR explorer
  • Added appropriate labels

@github-actions
Copy link

github-actions bot commented Jan 7, 2022

Cadence Benchstat comparison

This branch with compared with the base branch onflow:master commit b07c80c
The command for i in {1..N}; do go test ./... -run=XXX -bench=. -shuffle=on; done was used.
Bench tests were run a total of 7 times on each branch.

Results

old.txtnew.txt
time/opdelta
NewInterpreter/new_interpreter-21.19µs ± 2%1.24µs ± 1%+4.22%(p=0.001 n=7+6)
RuntimeResourceDictionaryValues-216.2ms ± 2%16.3ms ± 3%~(p=0.902 n=7+7)
RuntimeFungibleTokenTransfer-21.41ms ±22%1.34ms ±27%~(p=0.902 n=7+7)
ParseArray-216.9ms ± 4%17.0ms ± 6%~(p=0.902 n=7+7)
ParseInfix-211.2µs ± 3%11.2µs ± 3%~(p=0.805 n=7+7)
ParseDeploy/byte_array-227.1ms ± 4%27.6ms ± 4%~(p=0.180 n=6+6)
ParseDeploy/decode_hex-21.37ms ± 1%1.37ms ± 1%~(p=0.318 n=7+7)
ParseFungibleToken-2215µs ± 8%217µs ± 5%~(p=0.259 n=7+7)
QualifiedIdentifierCreation/One_level-23.16ns ± 1%3.14ns ± 1%~(p=0.259 n=7+7)
QualifiedIdentifierCreation/Three_levels-2161ns ± 3%165ns ± 4%~(p=0.104 n=7+7)
ContractInterfaceFungibleToken-246.7µs ± 3%46.5µs ± 1%~(p=0.628 n=7+6)
CheckContractInterfaceFungibleTokenConformance-2155µs ± 7%154µs ± 6%~(p=1.000 n=7+7)
InterpretRecursionFib-22.71ms ± 2%2.73ms ± 3%~(p=0.620 n=7+7)
NewInterpreter/new_sub-interpreter-22.39µs ± 4%2.44µs ± 1%~(p=0.209 n=7+7)
 
alloc/opdelta
NewInterpreter/new_interpreter-2720B ± 0%768B ± 0%+6.67%(p=0.001 n=7+7)
NewInterpreter/new_sub-interpreter-21.18kB ± 0%1.24kB ± 0%+5.44%(p=0.001 n=7+7)
RuntimeFungibleTokenTransfer-2273kB ± 0%273kB ± 0%+0.07%(p=0.001 n=7+7)
RuntimeResourceDictionaryValues-24.05MB ± 0%4.05MB ± 0%~(p=0.535 n=7+7)
QualifiedIdentifierCreation/One_level-20.00B 0.00B ~(all equal)
QualifiedIdentifierCreation/Three_levels-264.0B ± 0%64.0B ± 0%~(all equal)
ContractInterfaceFungibleToken-226.5kB ± 0%26.5kB ± 0%~(p=0.286 n=7+7)
CheckContractInterfaceFungibleTokenConformance-265.7kB ± 0%65.7kB ± 0%~(all equal)
InterpretRecursionFib-21.24MB ± 0%1.24MB ± 0%~(all equal)
 
allocs/opdelta
NewInterpreter/new_interpreter-211.0 ± 0%12.0 ± 0%+9.09%(p=0.001 n=7+7)
NewInterpreter/new_sub-interpreter-236.0 ± 0%38.0 ± 0%+5.56%(p=0.001 n=7+7)
RuntimeFungibleTokenTransfer-24.54k ± 0%4.54k ± 0%+0.12%(p=0.001 n=7+7)
RuntimeResourceDictionaryValues-2102k ± 0%102k ± 0%+0.00%(p=0.021 n=7+7)
QualifiedIdentifierCreation/One_level-20.00 0.00 ~(all equal)
QualifiedIdentifierCreation/Three_levels-22.00 ± 0%2.00 ± 0%~(all equal)
ContractInterfaceFungibleToken-2457 ± 0%457 ± 0%~(all equal)
CheckContractInterfaceFungibleTokenConformance-21.07k ± 0%1.07k ± 0%~(all equal)
InterpretRecursionFib-225.0k ± 0%25.0k ± 0%~(all equal)
 

@codecov-commenter
Copy link

codecov-commenter commented Jan 7, 2022

Codecov Report

Merging #1344 (1dc3d57) into master (2eb9cf7) will increase coverage by 0.10%.
The diff coverage is 85.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1344      +/-   ##
==========================================
+ Coverage   75.67%   75.77%   +0.10%     
==========================================
  Files         279      280       +1     
  Lines       38572    38763     +191     
==========================================
+ Hits        29190    29374     +184     
- Misses       8038     8039       +1     
- Partials     1344     1350       +6     
Flag Coverage Δ
unittests 75.77% <85.00%> (+0.10%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
runtime/interpreter/value.go 71.37% <76.31%> (+0.35%) ⬆️
runtime/interpreter/interpreter.go 88.14% <100.00%> (+0.13%) ⬆️
runtime/interpreter/interpreter_expression.go 81.16% <100.00%> (+0.07%) ⬆️
runtime/parser2/parser.go 92.71% <0.00%> (-2.85%) ⬇️
runtime/interpreter/errors.go 20.71% <0.00%> (-1.43%) ⬇️
runtime/parser2/lexer/lexer.go 94.21% <0.00%> (-0.89%) ⬇️
runtime/parser2/type.go 84.28% <0.00%> (-0.69%) ⬇️
runtime/parser2/lexer/token.go 71.42% <0.00%> (ø)
runtime/sema/check_composite_declaration.go 95.48% <0.00%> (+0.03%) ⬆️
runtime/sema/type.go 88.45% <0.00%> (+0.26%) ⬆️
... and 7 more

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 2eb9cf7...1dc3d57. Read the comment docs.

Copy link
Member

@SupunS SupunS left a comment

Choose a reason for hiding this comment

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

LGTM! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ownership of nested resources is inconsistent, breaks backwards compatibility
4 participants