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

Avoid type-checking of the old program during contract updates #1692

Merged
merged 2 commits into from
Jun 6, 2022

Conversation

turbolent
Copy link
Member

Description

Port #1689 to master


  • 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

@turbolent turbolent requested a review from SupunS as a code owner June 3, 2022 21:10
@turbolent turbolent self-assigned this Jun 3, 2022
@turbolent turbolent requested a review from dsainati1 as a code owner June 3, 2022 21:10
@github-actions
Copy link

github-actions bot commented Jun 3, 2022

Cadence Benchstat comparison

This branch with compared with the base branch onflow:master commit 16c5038
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.

Results

old.txtnew.txt
time/opdelta
CheckContractInterfaceFungibleTokenConformance-2175µs ± 2%172µs ± 2%~(p=0.165 n=7+7)
ContractInterfaceFungibleToken-252.7µs ± 4%52.0µs ± 6%~(p=0.318 n=7+7)
InterpretRecursionFib-23.50ms ± 6%3.49ms ±10%~(p=0.383 n=7+7)
NewInterpreter/new_interpreter-21.36µs ± 0%1.38µs ± 1%+1.23%(p=0.016 n=5+5)
NewInterpreter/new_sub-interpreter-22.90µs ± 1%2.89µs ± 8%~(p=0.836 n=6+7)
ParseArray-211.1ms ± 5%11.0ms ± 2%~(p=0.710 n=7+7)
ParseDeploy/byte_array-216.7ms ± 3%16.6ms ± 3%~(p=0.456 n=7+7)
ParseDeploy/decode_hex-21.38ms ± 4%1.45ms ± 4%+5.03%(p=0.004 n=7+7)
ParseFungibleToken/With_memory_metering-2258µs ± 4%261µs ± 1%~(p=0.181 n=7+6)
ParseFungibleToken/Without_memory_metering-2199µs ± 3%200µs ± 3%~(p=0.710 n=7+7)
ParseInfix-29.41µs ± 6%9.42µs ± 4%~(p=0.902 n=7+7)
QualifiedIdentifierCreation/One_level-23.26ns ± 3%3.25ns ± 4%~(p=0.620 n=7+7)
QualifiedIdentifierCreation/Three_levels-2175ns ± 1%171ns ± 4%~(p=0.053 n=5+7)
RuntimeFungibleTokenTransfer-21.45ms ±19%1.52ms ±21%~(p=0.805 n=7+7)
RuntimeResourceDictionaryValues-27.87ms ± 2%7.64ms ± 3%−2.88%(p=0.009 n=6+6)
Transfer-2109ns ± 2%110ns ± 3%~(p=0.312 n=6+7)
 
alloc/opdelta
CheckContractInterfaceFungibleTokenConformance-266.3kB ± 0%66.3kB ± 0%~(all equal)
ContractInterfaceFungibleToken-226.7kB ± 0%26.7kB ± 0%~(all equal)
InterpretRecursionFib-21.25MB ± 0%1.25MB ± 0%~(p=0.061 n=6+6)
NewInterpreter/new_interpreter-2872B ± 0%872B ± 0%~(all equal)
NewInterpreter/new_sub-interpreter-21.38kB ± 0%1.38kB ± 0%~(all equal)
ParseArray-22.81MB ± 2%2.81MB ± 2%~(p=0.512 n=7+7)
ParseDeploy/byte_array-24.48MB ± 3%4.48MB ± 3%~(p=0.646 n=7+7)
ParseDeploy/decode_hex-2214kB ± 0%214kB ± 0%−0.05%(p=0.048 n=7+6)
ParseFungibleToken/With_memory_metering-236.3kB ± 0%36.3kB ± 0%~(p=0.913 n=7+7)
ParseFungibleToken/Without_memory_metering-236.3kB ± 0%36.3kB ± 0%~(p=0.168 n=7+7)
ParseInfix-22.17kB ± 0%2.17kB ± 0%~(p=0.232 n=7+5)
QualifiedIdentifierCreation/One_level-20.00B 0.00B ~(all equal)
QualifiedIdentifierCreation/Three_levels-264.0B ± 0%64.0B ± 0%~(all equal)
RuntimeFungibleTokenTransfer-2237kB ± 1%237kB ± 0%~(p=0.383 n=7+7)
RuntimeResourceDictionaryValues-22.25MB ± 0%2.25MB ± 0%~(p=1.000 n=7+7)
Transfer-248.0B ± 0%48.0B ± 0%~(all equal)
 
allocs/opdelta
CheckContractInterfaceFungibleTokenConformance-21.07k ± 0%1.07k ± 0%~(all equal)
ContractInterfaceFungibleToken-2460 ± 0%460 ± 0%~(all equal)
InterpretRecursionFib-223.8k ± 0%23.8k ± 0%~(all equal)
NewInterpreter/new_interpreter-212.0 ± 0%12.0 ± 0%~(all equal)
NewInterpreter/new_sub-interpreter-240.0 ± 0%40.0 ± 0%~(all equal)
ParseArray-270.0k ± 0%70.0k ± 0%−0.01%(p=0.042 n=6+7)
ParseDeploy/byte_array-2105k ± 0%105k ± 0%~(p=0.098 n=6+7)
ParseDeploy/decode_hex-278.0 ± 0%78.0 ± 0%~(all equal)
ParseFungibleToken/With_memory_metering-21.06k ± 0%1.06k ± 0%~(all equal)
ParseFungibleToken/Without_memory_metering-21.06k ± 0%1.06k ± 0%~(all equal)
ParseInfix-266.0 ± 0%66.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-24.52k ± 0%4.52k ± 0%~(p=1.000 n=7+7)
RuntimeResourceDictionaryValues-237.6k ± 0%37.6k ± 0%~(p=0.690 n=7+7)
Transfer-21.00 ± 0%1.00 ± 0%~(all equal)
 

@turbolent turbolent force-pushed the bastian/port-1689-master branch from 2136157 to 88b4d7e Compare June 3, 2022 21:35
@codecov
Copy link

codecov bot commented Jun 6, 2022

Codecov Report

Merging #1692 (88b4d7e) into master (16c5038) will decrease coverage by 0.00%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master    #1692      +/-   ##
==========================================
- Coverage   76.64%   76.63%   -0.01%     
==========================================
  Files         292      292              
  Lines       61199    61195       -4     
==========================================
- Hits        46904    46896       -8     
- Misses      12682    12686       +4     
  Partials     1613     1613              
Flag Coverage Δ
unittests 76.63% <100.00%> (-0.01%) ⬇️

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

Impacted Files Coverage Δ
runtime/runtime.go 86.51% <100.00%> (-0.03%) ⬇️
runtime/sema/simple_type.go 92.30% <0.00%> (-3.85%) ⬇️
runtime/interpreter/storage.go 69.04% <0.00%> (-1.59%) ⬇️

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 16c5038...88b4d7e. Read the comment docs.

@turbolent turbolent merged commit e4319fa into master Jun 6, 2022
@turbolent turbolent deleted the bastian/port-1689-master branch June 6, 2022 20:33
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.

3 participants