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

Address some tech debt #2155

Merged
merged 4 commits into from
Nov 18, 2022
Merged

Address some tech debt #2155

merged 4 commits into from
Nov 18, 2022

Conversation

turbolent
Copy link
Member

@turbolent turbolent commented Nov 18, 2022

Description

  • Use constant for predeclared contract account field name
  • Fix constant name for Capability address field docstring
  • Optimize AuthAccount value: cache functions

  • 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 18, 2022

Codecov Report

Merging #2155 (4e46af8) into master (ae37a27) will decrease coverage by 0.28%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master    #2155      +/-   ##
==========================================
- Coverage   77.97%   77.68%   -0.29%     
==========================================
  Files         308      308              
  Lines       64163    64246      +83     
==========================================
- Hits        50029    49910     -119     
- Misses      12336    12600     +264     
+ Partials     1798     1736      -62     
Flag Coverage Δ
unittests 77.68% <100.00%> (-0.29%) ⬇️

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

Impacted Files Coverage Δ
runtime/environment.go 91.73% <100.00%> (ø)
runtime/interpreter/account.go 92.66% <100.00%> (+3.32%) ⬆️
runtime/sema/checker.go 92.15% <100.00%> (+0.04%) ⬆️
runtime/sema/type.go 89.97% <100.00%> (+<0.01%) ⬆️
runtime/interpreter/value.go 68.96% <0.00%> (-1.74%) ⬇️
runtime/interpreter/decode.go 46.05% <0.00%> (-0.09%) ⬇️
runtime/stdlib/test.go 38.19% <0.00%> (ø)
runtime/common/metering.go 92.23% <0.00%> (ø)
runtime/common/memorykind_string.go 40.00% <0.00%> (ø)
... and 3 more

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

@github-actions
Copy link

github-actions bot commented Nov 18, 2022

Cadence Benchstat comparison

This branch with compared with the base branch onflow:master commit 7969b6b
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-2140µs ± 9%134µs ± 1%~(p=0.051 n=7+6)
ContractInterfaceFungibleToken-246.8µs ± 2%48.8µs ±15%~(p=0.628 n=6+7)
InterpretRecursionFib-22.67ms ± 2%2.76ms ±10%~(p=0.805 n=7+7)
NewInterpreter/new_interpreter-21.41µs ± 1%1.33µs ± 2%−5.72%(p=0.001 n=6+7)
NewInterpreter/new_sub-interpreter-2765ns ± 1%713ns ± 2%−6.82%(p=0.001 n=6+7)
ParseArray-29.70ms ± 4%9.76ms ± 7%~(p=0.710 n=7+7)
ParseDeploy/byte_array-214.6ms ± 7%14.7ms ± 7%~(p=0.318 n=7+7)
ParseDeploy/decode_hex-21.47ms ± 4%1.46ms ± 3%~(p=1.000 n=7+7)
ParseFungibleToken/With_memory_metering-2224µs ± 4%227µs ± 3%~(p=0.383 n=7+7)
ParseFungibleToken/Without_memory_metering-2175µs ± 3%176µs ± 2%~(p=0.445 n=7+6)
ParseInfix-28.19µs ± 3%8.17µs ± 2%~(p=1.000 n=7+7)
QualifiedIdentifierCreation/One_level-22.77ns ± 1%2.78ns ± 3%~(p=1.000 n=7+7)
QualifiedIdentifierCreation/Three_levels-2166ns ± 3%165ns ± 1%~(p=0.154 n=7+7)
RuntimeFungibleTokenTransfer-2586µs ± 4%748µs ±21%+27.76%(p=0.005 n=6+7)
RuntimeResourceDictionaryValues-26.15ms ± 3%6.11ms ± 2%~(p=0.731 n=7+6)
RuntimeScriptNoop-217.2µs ± 3%21.7µs ±29%+26.20%(p=0.014 n=6+7)
SuperTypeInference/arrays-2381ns ± 2%371ns ± 1%−2.45%(p=0.002 n=7+6)
SuperTypeInference/composites-2156ns ± 3%154ns ± 1%~(p=0.272 n=7+6)
SuperTypeInference/integers-2106ns ± 5%105ns ± 1%~(p=0.710 n=7+7)
ValueIsSubtypeOfSemaType-2110ns ±10%108ns ± 2%~(p=0.731 n=7+6)
 
alloc/opdelta
CheckContractInterfaceFungibleTokenConformance-249.7kB ± 0%49.7kB ± 0%~(all equal)
ContractInterfaceFungibleToken-224.0kB ± 0%24.0kB ± 0%~(all equal)
InterpretRecursionFib-21.00MB ± 0%1.00MB ± 0%~(all equal)
NewInterpreter/new_interpreter-2752B ± 0%752B ± 0%~(all equal)
NewInterpreter/new_sub-interpreter-2200B ± 0%200B ± 0%~(all equal)
ParseArray-22.73MB ± 4%2.81MB ±10%~(p=0.318 n=7+7)
ParseDeploy/byte_array-24.18MB ± 3%4.21MB ± 3%~(p=0.902 n=7+7)
ParseDeploy/decode_hex-2214kB ± 0%214kB ± 0%~(p=0.210 n=7+7)
ParseFungibleToken/With_memory_metering-229.2kB ± 0%29.2kB ± 0%~(p=0.595 n=7+7)
ParseFungibleToken/Without_memory_metering-229.2kB ± 0%29.2kB ± 0%~(p=0.462 n=7+7)
ParseInfix-21.92kB ± 0%1.92kB ± 0%~(p=0.240 n=5+7)
QualifiedIdentifierCreation/One_level-20.00B 0.00B ~(all equal)
QualifiedIdentifierCreation/Three_levels-264.0B ± 0%64.0B ± 0%~(all equal)
RuntimeFungibleTokenTransfer-2102kB ± 0%103kB ± 1%+0.83%(p=0.001 n=6+7)
RuntimeResourceDictionaryValues-22.29MB ± 0%2.29MB ± 0%~(p=0.902 n=7+7)
RuntimeScriptNoop-28.44kB ± 1%8.44kB ± 0%~(p=0.730 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=1.000 n=6+7)
ParseDeploy/byte_array-289.4k ± 0%89.4k ± 0%~(p=1.000 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.98k ± 0%1.99k ± 0%+0.71%(p=0.001 n=7+6)
RuntimeResourceDictionaryValues-236.9k ± 0%36.9k ± 0%+0.03%(p=0.001 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 merged commit 8b67509 into master Nov 18, 2022
@turbolent turbolent deleted the bastian/clean-up-authaccount branch November 18, 2022 22:20
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