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

Gracefully handle casts during comparison operators #1330

Merged
merged 6 commits into from
Jan 5, 2022

Conversation

SupunS
Copy link
Member

@SupunS SupunS commented Jan 4, 2022

Port of https://github.com/dapperlabs/cadence-internal/pull/46

Description

Handle Go casts during comparison operators (<, <=, >, >=).


  • 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-commenter
Copy link

Codecov Report

Merging #1330 (48909b9) into master (834f5f1) will increase coverage by 0.35%.
The diff coverage is 88.90%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1330      +/-   ##
==========================================
+ Coverage   75.57%   75.93%   +0.35%     
==========================================
  Files         279      279              
  Lines       37813    38373     +560     
==========================================
+ Hits        28578    29138     +560     
  Misses       7958     7958              
  Partials     1277     1277              
Flag Coverage Δ
unittests 75.93% <88.90%> (+0.35%) ⬆️

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

Impacted Files Coverage Δ
runtime/interpreter/value.go 71.49% <88.90%> (+2.54%) ⬆️

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 834f5f1...48909b9. Read the comment docs.

@github-actions
Copy link

github-actions bot commented Jan 4, 2022

Cadence Benchstat comparison

This branch with compared with the base branch onflow:master commit 834f5f1
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.52ms ±23%1.58ms ±20%~(p=0.805 n=7+7)
RuntimeResourceDictionaryValues-216.9ms ± 5%17.1ms ± 4%~(p=0.805 n=7+7)
ParseFungibleToken-2495µs ± 3%492µs ± 4%~(p=0.535 n=7+7)
ParseInfix-225.3µs ± 2%25.2µs ± 2%~(p=0.710 n=7+7)
ParseDeploy/byte_array-236.4ms ± 3%36.0ms ± 3%~(p=0.383 n=7+7)
ParseDeploy/decode_hex-21.55ms ± 1%1.55ms ± 4%~(p=1.000 n=7+7)
QualifiedIdentifierCreation/One_level-23.44ns ± 2%3.41ns ± 3%~(p=0.435 n=7+7)
QualifiedIdentifierCreation/Three_levels-2178ns ± 3%176ns ± 2%~(p=0.456 n=7+7)
CheckContractInterfaceFungibleTokenConformance-2178µs ± 5%176µs ± 1%~(p=0.731 n=7+6)
ContractInterfaceFungibleToken-249.4µs ± 2%49.3µs ± 3%~(p=0.836 n=6+7)
NewInterpreter/new_interpreter-21.25µs ± 2%1.25µs ± 5%~(p=0.945 n=6+7)
InterpretRecursionFib-22.84ms ± 2%2.93ms ± 6%~(p=0.181 n=6+7)
ParseArray-224.4ms ± 2%23.7ms ± 3%−3.11%(p=0.011 n=7+7)
NewInterpreter/new_sub-interpreter-22.57µs ± 5%2.44µs ± 2%−5.08%(p=0.035 n=7+6)
 
alloc/opdelta
RuntimeFungibleTokenTransfer-2238kB ± 0%238kB ± 0%~(p=0.967 n=7+6)
RuntimeResourceDictionaryValues-24.04MB ± 0%4.04MB ± 0%~(p=0.165 n=7+7)
QualifiedIdentifierCreation/One_level-20.00B 0.00B ~(all equal)
QualifiedIdentifierCreation/Three_levels-264.0B ± 0%64.0B ± 0%~(all equal)
CheckContractInterfaceFungibleTokenConformance-265.7kB ± 0%65.7kB ± 0%~(all equal)
ContractInterfaceFungibleToken-226.5kB ± 0%26.5kB ± 0%~(all equal)
NewInterpreter/new_interpreter-2720B ± 0%720B ± 0%~(all equal)
NewInterpreter/new_sub-interpreter-21.18kB ± 0%1.18kB ± 0%~(all equal)
InterpretRecursionFib-21.24MB ± 0%1.24MB ± 0%~(p=0.462 n=7+7)
 
allocs/opdelta
RuntimeFungibleTokenTransfer-24.54k ± 0%4.54k ± 0%~(p=0.761 n=7+7)
RuntimeResourceDictionaryValues-2102k ± 0%102k ± 0%~(p=0.170 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-2457 ± 0%457 ± 0%~(all equal)
NewInterpreter/new_interpreter-211.0 ± 0%11.0 ± 0%~(all equal)
NewInterpreter/new_sub-interpreter-236.0 ± 0%36.0 ± 0%~(all equal)
InterpretRecursionFib-225.0k ± 0%25.0k ± 0%~(all equal)
 

@SupunS SupunS merged commit 34cca3c into master Jan 5, 2022
@SupunS SupunS deleted the supun/fix-binary-ops branch January 5, 2022 20:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants