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

Commit storage before getting account storage capacity #1525

Merged
merged 1 commit into from
Mar 23, 2022

Conversation

robert-e-davidson3
Copy link
Contributor

@robert-e-davidson3 robert-e-davidson3 commented Mar 22, 2022

Closes #1367

Description

Commit to storage before getting account storage capacity.
Otherwise it won't update when FLOW tokens are moved.


  • 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

@robert-e-davidson3 robert-e-davidson3 force-pushed the robert/1367-get-storage-capacity branch from 9a07d51 to c841b85 Compare March 22, 2022 21:26
@github-actions
Copy link

github-actions bot commented Mar 22, 2022

Cadence Benchstat comparison

This branch with compared with the base branch onflow:master commit 668062c
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.54ms ±18%1.74ms ± 7%~(p=0.181 n=7+6)
RuntimeResourceDictionaryValues-218.8ms ± 7%17.9ms ± 9%~(p=0.073 n=7+7)
ParseFungibleToken-2245µs ± 7%243µs ± 6%~(p=0.620 n=7+7)
ParseInfix-211.2µs ± 8%10.8µs ± 8%~(p=0.318 n=7+7)
ParseArray-220.2ms ± 2%20.5ms ±12%~(p=0.836 n=6+7)
ParseDeploy/byte_array-234.0ms ± 9%33.2ms ± 8%~(p=0.456 n=7+7)
ParseDeploy/decode_hex-21.48ms ± 4%1.52ms ± 4%~(p=0.138 n=6+7)
QualifiedIdentifierCreation/One_level-22.92ns ± 8%2.84ns ± 4%~(p=0.604 n=7+6)
QualifiedIdentifierCreation/Three_levels-2183ns ±10%181ns ± 5%~(p=0.805 n=7+7)
CheckContractInterfaceFungibleTokenConformance-2176µs ± 7%174µs ± 8%~(p=0.902 n=7+7)
ContractInterfaceFungibleToken-251.8µs ± 4%53.4µs ± 9%~(p=0.295 n=6+7)
InterpretRecursionFib-23.41ms ± 5%3.58ms ± 5%~(p=0.073 n=6+7)
NewInterpreter/new_interpreter-21.50µs ± 6%1.49µs ± 3%~(p=0.685 n=7+7)
NewInterpreter/new_sub-interpreter-22.97µs ± 2%2.87µs ± 2%−3.19%(p=0.009 n=6+6)
 
alloc/opdelta
RuntimeFungibleTokenTransfer-2273kB ± 0%273kB ± 0%+0.04%(p=0.001 n=6+7)
RuntimeResourceDictionaryValues-24.05MB ± 0%4.05MB ± 0%~(p=0.932 n=7+7)
QualifiedIdentifierCreation/One_level-20.00B 0.00B ~(all equal)
QualifiedIdentifierCreation/Three_levels-264.0B ± 0%64.0B ± 0%~(all equal)
CheckContractInterfaceFungibleTokenConformance-266.2kB ± 0%66.2kB ± 0%~(all equal)
ContractInterfaceFungibleToken-226.6kB ± 0%26.6kB ± 0%~(p=0.538 n=6+7)
InterpretRecursionFib-21.26MB ± 0%1.26MB ± 0%~(p=1.000 n=7+7)
NewInterpreter/new_interpreter-2848B ± 0%848B ± 0%~(all equal)
NewInterpreter/new_sub-interpreter-21.34kB ± 0%1.34kB ± 0%~(all equal)
 
allocs/opdelta
RuntimeFungibleTokenTransfer-24.54k ± 0%4.54k ± 0%~(p=0.711 n=7+6)
RuntimeResourceDictionaryValues-2102k ± 0%102k ± 0%~(p=0.688 n=7+7)
QualifiedIdentifierCreation/One_level-20.00 0.00 ~(all equal)
QualifiedIdentifierCreation/Three_levels-22.00 ± 0%2.00 ± 0%~(all equal)
CheckContractInterfaceFungibleTokenConformance-21.07k ± 0%1.07k ± 0%~(all equal)
ContractInterfaceFungibleToken-2458 ± 0%458 ± 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-240.0 ± 0%40.0 ± 0%~(all equal)
 

Copy link
Member

@turbolent turbolent left a comment

Choose a reason for hiding this comment

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

Nice work! Thanks again for debugging this through many layers and finding the culprit 👍

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.

Unexpected changes in an account's storage capacity
2 participants