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

Check capabilities of dependencies #1476

Merged
merged 1 commit into from
Mar 3, 2022
Merged

Conversation

turbolent
Copy link
Member

Description

Add support for gocap. This was recommended by @fxamacker 🙏


  • 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 added the Chore label Mar 3, 2022
@turbolent turbolent requested a review from fxamacker March 3, 2022 21:39
@turbolent turbolent self-assigned this Mar 3, 2022
@turbolent turbolent changed the title Check capabilities Check capabilities of dependencies Mar 3, 2022
@github-actions
Copy link

github-actions bot commented Mar 3, 2022

Cadence Benchstat comparison

This branch with compared with the base branch onflow:master commit 4f14349
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.46ms ±34%1.25ms ± 5%~(p=0.051 n=7+6)
ParseInfix-210.5µs ± 7%10.1µs ± 5%~(p=0.128 n=7+7)
ParseFungibleToken-2243µs ± 4%237µs ± 7%~(p=0.209 n=7+7)
ParseDeploy/byte_array-224.3ms ± 9%23.8ms ± 5%~(p=0.628 n=7+6)
ParseDeploy/decode_hex-21.47ms ± 4%1.45ms ± 6%~(p=0.234 n=6+7)
QualifiedIdentifierCreation/One_level-23.51ns ± 6%3.47ns ± 7%~(p=0.710 n=7+7)
QualifiedIdentifierCreation/Three_levels-2180ns ± 4%182ns ± 5%~(p=0.383 n=7+7)
ContractInterfaceFungibleToken-250.1µs ± 4%50.3µs ± 4%~(p=1.000 n=6+7)
CheckContractInterfaceFungibleTokenConformance-2179µs ± 2%178µs ± 7%~(p=0.268 n=5+7)
InterpretRecursionFib-23.42ms ± 8%3.35ms ± 5%~(p=0.456 n=7+7)
NewInterpreter/new_interpreter-21.40µs ± 5%1.38µs ± 3%~(p=0.461 n=6+6)
NewInterpreter/new_sub-interpreter-22.69µs ± 1%2.64µs ± 3%~(p=0.082 n=5+6)
RuntimeResourceDictionaryValues-217.8ms ± 3%17.2ms ± 2%−3.32%(p=0.004 n=6+6)
ParseArray-216.1ms ± 7%15.4ms ± 3%−4.46%(p=0.022 n=7+6)
 
alloc/opdelta
RuntimeResourceDictionaryValues-24.05MB ± 0%4.05MB ± 0%~(p=0.318 n=7+7)
RuntimeFungibleTokenTransfer-2273kB ± 0%273kB ± 0%~(p=0.805 n=7+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%~(p=0.780 n=7+7)
NewInterpreter/new_interpreter-2848B ± 0%848B ± 0%~(all equal)
NewInterpreter/new_sub-interpreter-21.32kB ± 0%1.32kB ± 0%~(all equal)
 
allocs/opdelta
RuntimeResourceDictionaryValues-2102k ± 0%102k ± 0%~(p=0.205 n=7+7)
RuntimeFungibleTokenTransfer-24.53k ± 0%4.53k ± 0%~(p=0.538 n=7+6)
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-239.0 ± 0%39.0 ± 0%~(all equal)
 

@turbolent turbolent merged commit 7cb1535 into master Mar 3, 2022
@turbolent turbolent deleted the bastian/check-capabilities branch March 3, 2022 22:57
github.com/onflow/cadence/runtime/pretty (runtime)
github.com/opentracing/opentracing-go (network)
github.com/stretchr/testify/assert (runtime, file, network)
github.com/zeebo/blake3/internal/consts (file)
Copy link
Member

Choose a reason for hiding this comment

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

I wish we didn't have to allow file to any hash libraries. In this case blake3/internal/consts appears to just call os.GetEnv() and call cpu.* functions.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, same for the other packages: The parser has a utility to read a file, and the runtime usage in the interpreter is just to handle Go errors (Go's runtime.Error).

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