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

add memory kind last #1560

Merged
merged 2 commits into from
Apr 7, 2022
Merged

add memory kind last #1560

merged 2 commits into from
Apr 7, 2022

Conversation

dsainati1
Copy link
Contributor

Adds a new memory kind MemoryKindLast that should serve as an upper limit on memory kind values, allowing us to range over the minimum and maximum memory kinds.


  • 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

@dsainati1 dsainati1 self-assigned this Apr 6, 2022
@github-actions
Copy link

github-actions bot commented Apr 6, 2022

Cadence Benchstat comparison

This branch with compared with the base branch onflow:feature/memory-metering commit b8efa6a
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
RuntimeFungibleTokenTransfer-21.29ms ±24%1.16ms ±31%~(p=0.710 n=7+7)
RuntimeResourceDictionaryValues-214.4ms ± 2%14.4ms ± 2%~(p=0.902 n=7+7)
ParseDeploy/byte_array-221.2ms ± 7%21.0ms ± 3%~(p=1.000 n=7+7)
ParseDeploy/decode_hex-21.16ms ± 1%1.16ms ± 1%~(p=1.000 n=6+7)
ParseInfix-28.58µs ± 1%8.84µs ± 7%~(p=0.101 n=6+7)
ParseFungibleToken/Without_memory_metering-2187µs ± 1%193µs ± 8%~(p=0.731 n=6+7)
ParseFungibleToken/With_memory_metering-2201µs ± 1%200µs ± 1%~(p=0.534 n=7+6)
ParseArray-213.0ms ± 4%13.1ms ± 4%~(p=0.818 n=6+6)
QualifiedIdentifierCreation/One_level-22.68ns ± 0%2.68ns ± 0%~(p=0.678 n=7+7)
QualifiedIdentifierCreation/Three_levels-2137ns ± 1%138ns ± 1%~(p=0.226 n=6+7)
ContractInterfaceFungibleToken-239.3µs ± 2%40.5µs ±10%~(p=0.620 n=7+7)
CheckContractInterfaceFungibleTokenConformance-2131µs ± 1%131µs ± 1%~(p=1.000 n=7+6)
InterpretRecursionFib-22.85ms ± 3%2.84ms ± 1%~(p=0.710 n=7+7)
NewInterpreter/new_interpreter-21.13µs ± 0%1.12µs ± 1%~(p=0.385 n=5+6)
NewInterpreter/new_sub-interpreter-22.27µs ± 1%2.27µs ± 1%~(p=0.763 n=7+6)
 
alloc/opdelta
RuntimeFungibleTokenTransfer-2274kB ± 0%274kB ± 0%~(p=0.874 n=7+7)
RuntimeResourceDictionaryValues-24.05MB ± 0%4.05MB ± 0%~(p=0.234 n=7+6)
ParseFungibleToken/Without_memory_metering-2199kB ± 0%199kB ± 0%~(all equal)
ParseFungibleToken/With_memory_metering-2199kB ± 0%199kB ± 0%~(p=0.538 n=6+7)
QualifiedIdentifierCreation/One_level-20.00B 0.00B ~(all equal)
QualifiedIdentifierCreation/Three_levels-264.0B ± 0%64.0B ± 0%~(all equal)
ContractInterfaceFungibleToken-226.6kB ± 0%26.6kB ± 0%~(p=1.000 n=7+7)
CheckContractInterfaceFungibleTokenConformance-266.2kB ± 0%66.2kB ± 0%~(all equal)
InterpretRecursionFib-21.26MB ± 0%1.26MB ± 0%~(all equal)
NewInterpreter/new_interpreter-2848B ± 0%848B ± 0%~(all equal)
NewInterpreter/new_sub-interpreter-21.36kB ± 0%1.36kB ± 0%~(all equal)
 
allocs/opdelta
RuntimeFungibleTokenTransfer-24.54k ± 0%4.54k ± 0%~(p=0.592 n=7+7)
RuntimeResourceDictionaryValues-2102k ± 0%102k ± 0%~(p=0.277 n=7+6)
ParseFungibleToken/Without_memory_metering-21.07k ± 0%1.07k ± 0%~(all equal)
ParseFungibleToken/With_memory_metering-21.07k ± 0%1.07k ± 0%~(all equal)
QualifiedIdentifierCreation/One_level-20.00 0.00 ~(all equal)
QualifiedIdentifierCreation/Three_levels-22.00 ± 0%2.00 ± 0%~(all equal)
ContractInterfaceFungibleToken-2458 ± 0%458 ± 0%~(all equal)
CheckContractInterfaceFungibleTokenConformance-21.07k ± 0%1.07k ± 0%~(all equal)
InterpretRecursionFib-226.2k ± 0%26.2k ± 0%~(all equal)
NewInterpreter/new_interpreter-213.0 ± 0%13.0 ± 0%~(all equal)
NewInterpreter/new_sub-interpreter-241.0 ± 0%41.0 ± 0%~(all equal)
 

@codecov-commenter
Copy link

codecov-commenter commented Apr 6, 2022

Codecov Report

Merging #1560 (2145b20) into feature/memory-metering (b8efa6a) will increase coverage by 0.00%.
The diff coverage is n/a.

@@                   Coverage Diff                    @@
##           feature/memory-metering    #1560   +/-   ##
========================================================
  Coverage                    76.36%   76.36%           
========================================================
  Files                          293      293           
  Lines                        58780    58780           
========================================================
+ Hits                         44885    44888    +3     
+ Misses                       12319    12318    -1     
+ Partials                      1576     1574    -2     
Flag Coverage Δ
unittests 76.36% <ø> (+<0.01%) ⬆️

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

Impacted Files Coverage Δ
runtime/common/memorykind_string.go 0.00% <ø> (ø)
runtime/sema/simple_type.go 92.30% <0.00%> (-3.85%) ⬇️
runtime/sema/type.go 88.88% <0.00%> (+0.07%) ⬆️
runtime/sema/checker.go 89.65% <0.00%> (+0.11%) ⬆️

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 b8efa6a...2145b20. Read the comment docs.

@dsainati1 dsainati1 merged commit 903b8c5 into feature/memory-metering Apr 7, 2022
@dsainati1 dsainati1 deleted the memory-kind-last branch April 7, 2022 16:15
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.

None yet

3 participants