erigon-pulse/core/vm
Felix Lange 5f7826270c all: unify big.Int zero checks, use common/math in more places (#3716)
* common/math: optimize PaddedBigBytes, use it more

name              old time/op    new time/op    delta
PaddedBigBytes-8    71.1ns ± 5%    46.1ns ± 1%  -35.15%  (p=0.000 n=20+19)

name              old alloc/op   new alloc/op   delta
PaddedBigBytes-8     48.0B ± 0%     32.0B ± 0%  -33.33%  (p=0.000 n=20+20)

* all: unify big.Int zero checks

Various checks were in use. This commit replaces them all with Int.Sign,
which is cheaper and less code.

eg templates:

    func before(x *big.Int) bool { return x.BitLen() == 0 }
    func after(x *big.Int) bool  { return x.Sign() == 0 }

    func before(x *big.Int) bool { return x.BitLen() > 0 }
    func after(x *big.Int) bool  { return x.Sign() != 0 }

    func before(x *big.Int) int { return x.Cmp(common.Big0) }
    func after(x *big.Int) int  { return x.Sign() }

* common/math, crypto/secp256k1: make ReadBits public in package math
2017-02-28 15:09:11 +01:00
..
runtime common: move big integer math to common/math (#3699) 2017-02-26 22:21:51 +01:00
analysis.go all: fix license headers one more time 2015-07-23 18:35:11 +02:00
common.go all: unify big.Int zero checks, use common/math in more places (#3716) 2017-02-28 15:09:11 +01:00
contract.go core, core/state, core/vm: remove exported account getters (#3618) 2017-02-22 23:29:59 +01:00
contracts.go common: move big integer math to common/math (#3699) 2017-02-26 22:21:51 +01:00
doc.go all: update license information 2016-04-15 09:48:05 +02:00
errors.go core/vm: improved EVM run loop & instruction calling (#3378) 2017-01-05 11:52:10 +01:00
evm.go all: unify big.Int zero checks, use common/math in more places (#3716) 2017-02-28 15:09:11 +01:00
gas_table_test.go params: core, core/vm, miner: 64bit gas instructions 2017-02-13 21:44:25 +01:00
gas_table.go all: unify big.Int zero checks, use common/math in more places (#3716) 2017-02-28 15:09:11 +01:00
gas.go params: core, core/vm, miner: 64bit gas instructions 2017-02-13 21:44:25 +01:00
instructions.go all: unify big.Int zero checks, use common/math in more places (#3716) 2017-02-28 15:09:11 +01:00
int_pool_verifier_empty.go params: core, core/vm, miner: 64bit gas instructions 2017-02-13 21:44:25 +01:00
int_pool_verifier.go params: core, core/vm, miner: 64bit gas instructions 2017-02-13 21:44:25 +01:00
interface.go core, core/state, core/vm: remove exported account getters (#3618) 2017-02-22 23:29:59 +01:00
interpreter.go all: blidly swap out glog to our log15, logs need rework 2017-02-23 12:16:44 +02:00
intpool.go params: core, core/vm, miner: 64bit gas instructions 2017-02-13 21:44:25 +01:00
jump_table.go params: core, core/vm, miner: 64bit gas instructions 2017-02-13 21:44:25 +01:00
logger_test.go core, core/state, core/vm: remove exported account getters (#3618) 2017-02-22 23:29:59 +01:00
logger.go all: unify big.Int zero checks, use common/math in more places (#3716) 2017-02-28 15:09:11 +01:00
memory_table.go common: move big integer math to common/math (#3699) 2017-02-26 22:21:51 +01:00
memory.go params: core, core/vm, miner: 64bit gas instructions 2017-02-13 21:44:25 +01:00
noop.go core, core/state, core/vm: remove exported account getters (#3618) 2017-02-22 23:29:59 +01:00
opcodes.go Revert "params: core, core/vm, miner: 64bit gas instructions (#3514)" 2017-02-13 15:15:12 +01:00
stack_table.go params: core, core/vm, miner: 64bit gas instructions 2017-02-13 21:44:25 +01:00
stack.go core/vm: improved EVM run loop & instruction calling (#3378) 2017-01-05 11:52:10 +01:00
vm_jit_fake.go core, core/vm: implemented a generic environment (#3348) 2016-12-06 02:16:03 +01:00
vm_jit.go core/vm: improved EVM run loop & instruction calling (#3378) 2017-01-05 11:52:10 +01:00