diff options
author | chriseth <chris@ethereum.org> | 2019-01-22 20:49:41 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-22 20:49:41 +0800 |
commit | 10d17f245839f208ec5085309022a32cd2502f55 (patch) | |
tree | b2c9f68980d0d418cd6f511e9f3f3f71369abe25 /test/cmdlineTests/gas_test_dispatch_optimize | |
parent | 1df8f40cd2fd7b47698d847907b8ca7b47eb488d (diff) | |
parent | 0ecafe032a84cb6960545dd7f18733430c1f782d (diff) | |
download | dexon-solidity-10d17f245839f208ec5085309022a32cd2502f55.tar.gz dexon-solidity-10d17f245839f208ec5085309022a32cd2502f55.tar.zst dexon-solidity-10d17f245839f208ec5085309022a32cd2502f55.zip |
Merge pull request #5836 from ethereum/develop
Merge develop into release for 0.5.3.
Diffstat (limited to 'test/cmdlineTests/gas_test_dispatch_optimize')
-rw-r--r-- | test/cmdlineTests/gas_test_dispatch_optimize/args | 1 | ||||
-rw-r--r-- | test/cmdlineTests/gas_test_dispatch_optimize/input.sol | 43 | ||||
-rw-r--r-- | test/cmdlineTests/gas_test_dispatch_optimize/output | 53 |
3 files changed, 97 insertions, 0 deletions
diff --git a/test/cmdlineTests/gas_test_dispatch_optimize/args b/test/cmdlineTests/gas_test_dispatch_optimize/args new file mode 100644 index 00000000..814e0591 --- /dev/null +++ b/test/cmdlineTests/gas_test_dispatch_optimize/args @@ -0,0 +1 @@ +--optimize --optimize-runs 2 --gas diff --git a/test/cmdlineTests/gas_test_dispatch_optimize/input.sol b/test/cmdlineTests/gas_test_dispatch_optimize/input.sol new file mode 100644 index 00000000..a5ca9e7d --- /dev/null +++ b/test/cmdlineTests/gas_test_dispatch_optimize/input.sol @@ -0,0 +1,43 @@ +pragma solidity >=0.0; + +contract Large { + uint public a; + uint[] public b; + function f1(uint x) public returns (uint) { a = x; b[uint8(msg.data[0])] = x; } + function f2(uint x) public returns (uint) { b[uint8(msg.data[1])] = x; } + function f3(uint x) public returns (uint) { b[uint8(msg.data[2])] = x; } + function f4(uint x) public returns (uint) { b[uint8(msg.data[3])] = x; } + function f5(uint x) public returns (uint) { b[uint8(msg.data[4])] = x; } + function f6(uint x) public returns (uint) { b[uint8(msg.data[5])] = x; } + function f7(uint x) public returns (uint) { b[uint8(msg.data[6])] = x; } + function f8(uint x) public returns (uint) { b[uint8(msg.data[7])] = x; } + function f9(uint x) public returns (uint) { b[uint8(msg.data[8])] = x; } + function f0(uint x) public pure returns (uint) { require(x > 10); } + function g1(uint x) public payable returns (uint) { a = x; b[uint8(msg.data[0])] = x; } + function g2(uint x) public payable returns (uint) { b[uint8(msg.data[1])] = x; } + function g3(uint x) public payable returns (uint) { b[uint8(msg.data[2])] = x; } + function g4(uint x) public payable returns (uint) { b[uint8(msg.data[3])] = x; } + function g5(uint x) public payable returns (uint) { b[uint8(msg.data[4])] = x; } + function g6(uint x) public payable returns (uint) { b[uint8(msg.data[5])] = x; } + function g7(uint x) public payable returns (uint) { b[uint8(msg.data[6])] = x; } + function g8(uint x) public payable returns (uint) { b[uint8(msg.data[7])] = x; } + function g9(uint x) public payable returns (uint) { b[uint8(msg.data[8])] = x; } + function g0(uint x) public payable returns (uint) { require(x > 10); } +} +contract Medium { + uint public a; + uint[] public b; + function f1(uint x) public returns (uint) { a = x; b[uint8(msg.data[0])] = x; } + function f2(uint x) public returns (uint) { b[uint8(msg.data[1])] = x; } + function f3(uint x) public returns (uint) { b[uint8(msg.data[2])] = x; } + function g7(uint x) public payable returns (uint) { b[uint8(msg.data[6])] = x; } + function g8(uint x) public payable returns (uint) { b[uint8(msg.data[7])] = x; } + function g9(uint x) public payable returns (uint) { b[uint8(msg.data[8])] = x; } + function g0(uint x) public payable returns (uint) { require(x > 10); } +} +contract Small { + uint public a; + uint[] public b; + function f1(uint x) public returns (uint) { a = x; b[uint8(msg.data[0])] = x; } + function () external payable {} +} diff --git a/test/cmdlineTests/gas_test_dispatch_optimize/output b/test/cmdlineTests/gas_test_dispatch_optimize/output new file mode 100644 index 00000000..fd8e9e93 --- /dev/null +++ b/test/cmdlineTests/gas_test_dispatch_optimize/output @@ -0,0 +1,53 @@ + +======= gas_test_dispatch_optimize/input.sol:Large ======= +Gas estimation: +construction: + 300 + 262000 = 262300 +external: + a(): 463 + b(uint256): 1173 + f0(uint256): 399 + f1(uint256): 41164 + f2(uint256): 21224 + f3(uint256): 21312 + f4(uint256): 21290 + f5(uint256): 21268 + f6(uint256): 21180 + f7(uint256): 20960 + f8(uint256): 21092 + f9(uint256): 21114 + g0(uint256): 639 + g1(uint256): 40876 + g2(uint256): 20958 + g3(uint256): 21046 + g4(uint256): 21024 + g5(uint256): 21112 + g6(uint256): 20892 + g7(uint256): 21002 + g8(uint256): 20980 + g9(uint256): 20826 + +======= gas_test_dispatch_optimize/input.sol:Medium ======= +Gas estimation: +construction: + 190 + 143000 = 143190 +external: + a(): 463 + b(uint256): 931 + f1(uint256): 40944 + f2(uint256): 20982 + f3(uint256): 21026 + g0(uint256): 397 + g7(uint256): 20892 + g8(uint256): 20870 + g9(uint256): 20826 + +======= gas_test_dispatch_optimize/input.sol:Small ======= +Gas estimation: +construction: + 117 + 67400 = 67517 +external: + fallback: 183 + a(): 441 + b(uint256): 821 + f1(uint256): 40878 |