mirror of https://github.com/status-im/EIPs.git
Update eip-616.md
This commit is contained in:
parent
b095d4dc01
commit
d31597eaa1
|
@ -125,7 +125,7 @@ operation | cycles | N = 2 | N = 4 | N = 8
|
||||||
add | 10 _N_ + 6 | 26 | 46 | 86
|
add | 10 _N_ + 6 | 26 | 46 | 86
|
||||||
subtract | 12 _N_ + 3 |27 | 51 | 99
|
subtract | 12 _N_ + 3 |27 | 51 | 99
|
||||||
multiply | 28 _N_**2 + 11 _N_ + 3 | 137 | 495 |1883
|
multiply | 28 _N_**2 + 11 _N_ + 3 | 137 | 495 |1883
|
||||||
divide | 30 (_N_**2)/2 + 119 _N_ + 111 | 409 | 827 | 2023
|
divide | 15 _N_**2 + 119 _N_ + 111 | 409 | 827 | 2023
|
||||||
|
|
||||||
The remaining operations are of about the same complexity as addition and subtraction, or less. Given that JUMPDEST is a no-op, and is assigned a gas price of 1, this can be taken as the overhead of the interpreter. All of the arithmetic operations are assigned the same gas price of 5, for a remaining runtime of 4. The interpreter loop itself takes about 6 to 8 C instructions, so ADD and SUB are reasonably priced, but MUL is some 5 to 21 times slower than ADD or SUB, and DIV is some 18 to 35 times slower, so they are clearly mispriced.
|
The remaining operations are of about the same complexity as addition and subtraction, or less. Given that JUMPDEST is a no-op, and is assigned a gas price of 1, this can be taken as the overhead of the interpreter. All of the arithmetic operations are assigned the same gas price of 5, for a remaining runtime of 4. The interpreter loop itself takes about 6 to 8 C instructions, so ADD and SUB are reasonably priced, but MUL is some 5 to 21 times slower than ADD or SUB, and DIV is some 18 to 35 times slower, so they are clearly mispriced.
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue