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

Use invocation's interpreter #2159

Merged
merged 2 commits into from
Nov 30, 2022

Conversation

turbolent
Copy link
Member

Description

Noticed while implementing #2151: We are currently not consistently using the invocation's interpreter.


  • 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

@codecov
Copy link

codecov bot commented Nov 23, 2022

Codecov Report

Merging #2159 (d216869) into master (d35e886) will increase coverage by 0.11%.
The diff coverage is 100.00%.

❗ Current head d216869 differs from pull request most recent head 29c9723. Consider uploading reports for the commit 29c9723 to get more accurate results

@@            Coverage Diff             @@
##           master    #2159      +/-   ##
==========================================
+ Coverage   77.58%   77.69%   +0.11%     
==========================================
  Files         309      308       -1     
  Lines       64688    64272     -416     
==========================================
- Hits        50186    49936     -250     
+ Misses      12760    12600     -160     
+ Partials     1742     1736       -6     
Flag Coverage Δ
unittests 77.69% <100.00%> (+0.11%) ⬆️

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

Impacted Files Coverage Δ
runtime/interpreter/interpreter.go 89.26% <100.00%> (+0.09%) ⬆️
runtime/interpreter/value.go 68.98% <100.00%> (+0.15%) ⬆️
runtime/interpreter/errors.go 56.82% <0.00%> (-0.61%) ⬇️
runtime/sema/errors.go 91.88% <0.00%> (-0.23%) ⬇️
runtime/interpreter/account.go 92.66% <0.00%> (-0.20%) ⬇️
runtime/interpreter/decode.go 46.05% <0.00%> (-0.15%) ⬇️
runtime/stdlib/account.go 86.44% <0.00%> (-0.13%) ⬇️
runtime/interpreter/encode.go 67.60% <0.00%> (-0.11%) ⬇️
runtime/environment.go 91.73% <0.00%> (-0.09%) ⬇️
runtime/sema/checker.go 92.15% <0.00%> (-0.04%) ⬇️
... and 12 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@turbolent turbolent requested a review from a team November 23, 2022 23:43
@github-actions
Copy link

github-actions bot commented Nov 23, 2022

Cadence Benchstat comparison

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

Collapsed results for better readability

old.txtnew.txt
time/opdelta
CheckContractInterfaceFungibleTokenConformance-2116µs ± 5%117µs ± 9%~(p=1.000 n=7+7)
ContractInterfaceFungibleToken-240.7µs ± 8%39.7µs ± 3%~(p=0.101 n=7+6)
InterpretRecursionFib-22.34ms ± 8%2.33ms ± 4%~(p=1.000 n=7+7)
NewInterpreter/new_interpreter-21.15µs ± 2%1.17µs ± 4%~(p=0.167 n=6+6)
NewInterpreter/new_sub-interpreter-2595ns ± 2%599ns ± 5%~(p=0.652 n=6+7)
ParseArray-28.13ms ± 4%8.15ms ± 8%~(p=0.805 n=7+7)
ParseDeploy/byte_array-212.2ms ± 3%12.1ms ± 2%~(p=0.534 n=6+7)
ParseDeploy/decode_hex-21.27ms ± 5%1.24ms ± 6%~(p=0.259 n=7+7)
ParseFungibleToken/With_memory_metering-2190µs ± 4%187µs ± 3%~(p=0.259 n=7+7)
ParseFungibleToken/Without_memory_metering-2149µs ± 4%147µs ± 4%~(p=0.318 n=7+7)
ParseInfix-26.86µs ± 2%6.87µs ± 6%~(p=0.300 n=7+7)
QualifiedIdentifierCreation/One_level-22.34ns ± 3%2.32ns ± 3%~(p=0.456 n=7+7)
QualifiedIdentifierCreation/Three_levels-2142ns ± 4%137ns ± 2%−3.10%(p=0.022 n=7+6)
RuntimeFungibleTokenTransfer-2698µs ± 2%570µs ±38%~(p=0.053 n=7+7)
RuntimeResourceDictionaryValues-25.38ms ± 5%5.29ms ± 4%~(p=0.383 n=7+7)
RuntimeScriptNoop-225.0µs ± 6%19.5µs ±36%~(p=0.234 n=6+7)
SuperTypeInference/arrays-2324ns ± 6%321ns ± 6%~(p=0.456 n=7+7)
SuperTypeInference/composites-2130ns ± 4%131ns ± 6%~(p=0.776 n=7+7)
SuperTypeInference/integers-291.2ns ± 4%91.0ns ± 7%~(p=0.620 n=7+7)
ValueIsSubtypeOfSemaType-297.6ns ± 4%95.2ns ± 3%~(p=0.128 n=7+7)
 
alloc/opdelta
CheckContractInterfaceFungibleTokenConformance-249.8kB ± 0%49.8kB ± 0%~(all equal)
ContractInterfaceFungibleToken-224.1kB ± 0%24.1kB ± 0%~(all equal)
InterpretRecursionFib-21.00MB ± 0%1.00MB ± 0%~(p=0.245 n=7+6)
NewInterpreter/new_interpreter-2768B ± 0%768B ± 0%~(all equal)
NewInterpreter/new_sub-interpreter-2200B ± 0%200B ± 0%~(all equal)
ParseArray-22.75MB ± 3%2.74MB ± 5%~(p=0.805 n=7+7)
ParseDeploy/byte_array-24.17MB ± 3%4.21MB ± 3%~(p=0.434 n=7+7)
ParseDeploy/decode_hex-2214kB ± 0%214kB ± 0%~(p=0.639 n=7+7)
ParseFungibleToken/With_memory_metering-229.2kB ± 0%29.2kB ± 0%~(p=0.706 n=7+7)
ParseFungibleToken/Without_memory_metering-229.2kB ± 0%29.2kB ± 0%~(p=0.270 n=7+7)
ParseInfix-21.91kB ± 0%1.91kB ± 0%~(p=0.499 n=7+7)
QualifiedIdentifierCreation/One_level-20.00B 0.00B ~(all equal)
QualifiedIdentifierCreation/Three_levels-264.0B ± 0%64.0B ± 0%~(all equal)
RuntimeFungibleTokenTransfer-2103kB ± 0%102kB ± 1%−1.03%(p=0.011 n=7+7)
RuntimeResourceDictionaryValues-22.28MB ± 0%2.28MB ± 0%~(p=0.902 n=7+7)
RuntimeScriptNoop-28.45kB ± 0%8.44kB ± 0%~(p=0.535 n=7+7)
SuperTypeInference/arrays-296.0B ± 0%96.0B ± 0%~(all equal)
SuperTypeInference/composites-20.00B 0.00B ~(all equal)
SuperTypeInference/integers-20.00B 0.00B ~(all equal)
ValueIsSubtypeOfSemaType-248.0B ± 0%48.0B ± 0%~(all equal)
 
allocs/opdelta
CheckContractInterfaceFungibleTokenConformance-2815 ± 0%815 ± 0%~(all equal)
ContractInterfaceFungibleToken-2388 ± 0%388 ± 0%~(all equal)
InterpretRecursionFib-218.9k ± 0%18.9k ± 0%~(all equal)
NewInterpreter/new_interpreter-213.0 ± 0%13.0 ± 0%~(all equal)
NewInterpreter/new_sub-interpreter-24.00 ± 0%4.00 ± 0%~(all equal)
ParseArray-259.6k ± 0%59.6k ± 0%~(p=0.286 n=7+7)
ParseDeploy/byte_array-289.4k ± 0%89.4k ± 0%~(p=0.286 n=7+7)
ParseDeploy/decode_hex-264.0 ± 0%64.0 ± 0%~(all equal)
ParseFungibleToken/With_memory_metering-2779 ± 0%779 ± 0%~(all equal)
ParseFungibleToken/Without_memory_metering-2779 ± 0%779 ± 0%~(all equal)
ParseInfix-248.0 ± 0%48.0 ± 0%~(all equal)
QualifiedIdentifierCreation/One_level-20.00 0.00 ~(all equal)
QualifiedIdentifierCreation/Three_levels-22.00 ± 0%2.00 ± 0%~(all equal)
RuntimeFungibleTokenTransfer-21.99k ± 0%1.99k ± 0%~(all equal)
RuntimeResourceDictionaryValues-236.9k ± 0%36.9k ± 0%~(p=0.906 n=7+7)
RuntimeScriptNoop-2132 ± 0%132 ± 0%~(all equal)
SuperTypeInference/arrays-23.00 ± 0%3.00 ± 0%~(all equal)
SuperTypeInference/composites-20.00 0.00 ~(all equal)
SuperTypeInference/integers-20.00 0.00 ~(all equal)
ValueIsSubtypeOfSemaType-21.00 ± 0%1.00 ± 0%~(all equal)
 

@turbolent turbolent requested a review from a team November 24, 2022 17:47
@turbolent turbolent merged commit 754b8ae into master Nov 30, 2022
@turbolent turbolent deleted the bastian/improve-host-function-interpreter branch November 30, 2022 22:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants