aboutsummaryrefslogtreecommitdiffstats
path: root/trie/hasher.go
Commit message (Collapse)AuthorAgeFilesLines
* trie: cache collapsed tries node, not rlp blobs (#16876)Péter Szilágyi2018-06-211-25/+5
| | | | | | | | | | | | The current trie memory database/cache that we do pruning on stores trie nodes as binary rlp encoded blobs, and also stores the node relationships/references for GC purposes. However, most of the trie nodes (everything apart from a value node) is in essence just a collection of references. This PR switches out the RLP encoded trie blobs with the collapsed-but-not-serialized trie nodes. This permits most of the references to be recovered from within the node data structure, avoiding the need to track them a second time (expensive memory wise).
* trie: reduce hasher allocations (#16896)Felix Lange2018-06-051-12/+38
| | | | | | | | | | | | | | | * trie: reduce hasher allocations name old time/op new time/op delta Hash-8 4.05µs ±12% 3.56µs ± 9% -12.13% (p=0.000 n=20+19) name old alloc/op new alloc/op delta Hash-8 1.30kB ± 0% 0.66kB ± 0% -49.15% (p=0.000 n=20+20) name old allocs/op new allocs/op delta Hash-8 11.0 ± 0% 8.0 ± 0% -27.27% (p=0.000 n=20+20) * trie: bump initial buffer cap in hasher
* trie: cleaner logic, one less func callPéter Szilágyi2018-05-241-2/+2
|
* core, trie: intermediate mempool between trie and database (#15857)Péter Szilágyi2018-02-061-11/+50
| | | This commit reduces database I/O by not writing every state trie to disk.
* Revert "trie: make fullnode children hash calculation concurrently (#15131)" ↵Péter Szilágyi2018-01-151-84/+27
| | | | | (#15889) This reverts commit 0f7fbb85d6e939510a3e3bb6493a9a332ddfd8e8.
* trie: make fullnode children hash calculation concurrently (#15131)gary rong2017-11-271-27/+84
| | | | | | | | | | * trie: make fullnode children hash calculation concurrently * trie: thread out only on topmost fullnode * trie: clean up full node children hash calculation * trie: minor code fixups
* trie: fix typo (#15152)Paul Litvak2017-09-191-1/+1
|
* rlp, trie, contracts, compression, consensus: improve comments (#14580)S. Matthew English2017-06-121-1/+1
|
* trie: rework and document key encodingFelix Lange2017-04-251-1/+1
| | | | | 'encode' and 'decode' are meaningless because the code deals with three encodings. Document the encodings and give a name to each one.
* all: fix spelling errorsPéter Szilágyi2017-01-071-1/+1
|
* trie: add metric to track cache unloading (#3175)Felix Lange2016-10-191-0/+1
|
* trie: ensure dirty flag is unset for embedded child nodesFelix Lange2016-10-181-17/+14
| | | | This was caught by the new invariant check.
* trie: ensure resolved nodes stay loadedFelix Lange2016-10-181-1/+1
| | | | | | | | Commit 40cdcf1183 broke the optimisation which kept nodes resolved during Get in the trie. The decoder assigned cache generation 0 unconditionally, causing resolved nodes to get flushed on Commit. This commit fixes it and adds two tests.
* trie, core/state: improve memory usage and performance (#3135)Felix Lange2016-10-151-30/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * trie: store nodes as pointers This avoids memory copies when unwrapping node interface values. name old time/op new time/op delta Get 388ns ± 8% 215ns ± 2% -44.56% (p=0.000 n=15+15) GetDB 363ns ± 3% 202ns ± 2% -44.21% (p=0.000 n=15+15) UpdateBE 1.57µs ± 2% 1.29µs ± 3% -17.80% (p=0.000 n=13+15) UpdateLE 1.92µs ± 2% 1.61µs ± 2% -16.25% (p=0.000 n=14+14) HashBE 2.16µs ± 6% 2.18µs ± 6% ~ (p=0.436 n=15+15) HashLE 7.43µs ± 3% 7.21µs ± 3% -2.96% (p=0.000 n=15+13) * trie: close temporary databases in GetDB benchmark * trie: don't keep []byte from DB load around Nodes decoded from a DB load kept hashes and values as sub-slices of the DB value. This can be a problem because loading from leveldb often returns []byte with a cap that's larger than necessary, increasing memory usage. * trie: unload old cached nodes * trie, core/state: use cache unloading for account trie * trie: use explicit private flags (fixes Go 1.5 reflection issue). * trie: fixup cachegen overflow at request of nick * core/state: rename journal size constant
* core, trie: replace state caches with trie journalFelix Lange2016-09-281-0/+157