mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-12 01:41:36 +00:00
For file-based alloc input, tokenize the JSON and insert each account into the pre-state StateDB as it is decoded, instead of materializing the full GenesisAlloc map first and then iterating it in MakePreState. Peak memory becomes a single decoded account rather than the whole alloc map, the decoder's buffer over it, and the StateDB populating alongside both. On the same benchmark-scale test that measured the output-streaming change, this dropped t8n peak heap_sys from ~8 GiB to ~3 GiB and cut an additional ~20s off wall-clock. The stdin input path still uses the map-based MakePreState since alloc shares a decoder with env/txs there; Prestate.AllocPath is how the file path opts in. |
||
|---|---|---|
| .. | ||
| block.go | ||
| execution.go | ||
| file_tracer.go | ||
| flags.go | ||
| gen_execresult.go | ||
| gen_header.go | ||
| gen_stenv.go | ||
| transaction.go | ||
| transition.go | ||
| tx_iterator.go | ||
| utils.go | ||