erigon-pulse/core
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
..
asm core, core/vm, cmd/disasm: unify procedures for disassembling evm code (#3530) 2017-02-27 12:21:19 +01:00
state all: unify big.Int zero checks, use common/math in more places (#3716) 2017-02-28 15:09:11 +01:00
types all: unify big.Int zero checks, use common/math in more places (#3716) 2017-02-28 15:09:11 +01:00
vm all: unify big.Int zero checks, use common/math in more places (#3716) 2017-02-28 15:09:11 +01:00
.gitignore Renamed chain => core 2014-12-04 10:28:02 +01:00
bench_test.go common: move big integer math to common/math (#3699) 2017-02-26 22:21:51 +01:00
block_validator_test.go cmd/geth, core: add support for recording SHA3 preimages (#3543) 2017-01-17 12:19:50 +01:00
block_validator.go common: move big integer math to common/math (#3699) 2017-02-26 22:21:51 +01:00
blockchain_test.go params: core, core/vm, miner: 64bit gas instructions 2017-02-13 21:44:25 +01:00
blockchain.go all: blidly swap out glog to our log15, logs need rework 2017-02-23 12:16:44 +02:00
blocks.go core, core/state: fixed consensus issue added touch revert 2016-11-24 22:12:54 +01:00
chain_makers_test.go params: core, core/vm, miner: 64bit gas instructions 2017-02-13 21:44:25 +01:00
chain_makers.go cmd/geth, core: add support for recording SHA3 preimages (#3543) 2017-01-17 12:19:50 +01:00
chain_pow_test.go core, core/state, trie: EIP158, reprice & skip empty account write 2016-11-13 10:44:04 +01:00
chain_pow.go core: separate and contain POW verifier, extensive tests 2015-09-21 10:24:49 +03:00
dao_test.go cmd/geth, core: add support for recording SHA3 preimages (#3543) 2017-01-17 12:19:50 +01:00
dao.go core, core/state, core/vm: remove exported account getters (#3618) 2017-02-22 23:29:59 +01:00
database_util_test.go common: move big integer math to common/math (#3699) 2017-02-26 22:21:51 +01:00
database_util.go core, eth: drop database block splitting upgrader 2017-02-28 13:41:02 +02:00
default_genesis.go core: remove support for Olympic network 2017-01-12 09:50:54 +01:00
error.go Merge pull request #1889 from karalabe/fast-sync-rebase 2015-10-21 11:44:22 -07:00
events.go core/vm: move Log to core/types 2017-01-06 14:15:22 +01:00
evm.go core, core/vm: implemented a generic environment (#3348) 2016-12-06 02:16:03 +01:00
fees.go Merge pull request #1515 from fjl/license-fixes 2015-07-28 04:29:42 -07:00
filter_test.go all: fix license headers one more time 2015-07-23 18:35:11 +02:00
gaspool.go all: update license information 2016-04-15 09:48:05 +02:00
genesis.go common: move big integer math to common/math (#3699) 2017-02-26 22:21:51 +01:00
headerchain.go all: unify big.Int zero checks, use common/math in more places (#3716) 2017-02-28 15:09:11 +01:00
helper_test.go cmd/geth, cmd/utils, core, rpc: renamed to blockchain 2015-10-04 01:13:56 +02:00
state_processor.go all: blidly swap out glog to our log15, logs need rework 2017-02-23 12:16:44 +02:00
state_transition.go common: move big integer math to common/math (#3699) 2017-02-26 22:21:51 +01:00
tx_list_test.go core: abstract out a sorted transaction hash map 2016-09-02 14:15:40 +03:00
tx_list.go all: fix spelling errors 2017-01-06 19:44:35 +02:00
tx_pool_test.go common: move big integer math to common/math (#3699) 2017-02-26 22:21:51 +01:00
tx_pool.go all: unify big.Int zero checks, use common/math in more places (#3716) 2017-02-28 15:09:11 +01:00
types.go core/vm: move Log to core/types 2017-01-06 14:15:22 +01:00