go-ethereum/eth
Daniel Liu 2b906f22f1
eth/tracers/js: avoid compiling js bigint when not needed #30640 (#1497)
While looking at some mem profiles from `evm` runs, I noticed that
`goja` compilation of the bigint library was present. The bigint library
compilation happens in a package `init`, whenever the package
`eth/tracers/js` is loaded. This PR changes it to load lazily when
needed.

It becomes slightly faster with this change, and slightly less alloc:y.

Non-scientific benchmark with 100 executions:
```
time for i in {1..100}; do ./evm --code 6040 run; done;
 ```

current `master`:

```
real    0m6.634s
user    0m5.213s
sys     0m2.277s
```
Without compiling bigint
```
real    0m5.802s
user    0m4.191s
sys     0m1.965s
```

Co-authored-by: Martin HS <martin@swende.se>
2025-09-17 08:17:18 +08:00
..
bft add syncinfo pool (#1236) 2025-07-28 01:43:41 -07:00
downloader eth/downloader, eth/tracer: fix typos in comments #29707 (#1472) 2025-09-13 10:30:25 +08:00
ethconfig cmd, eth: rename config and flag to VMTraceJsonConfig #29573 (#1490) 2025-09-13 10:52:31 +08:00
fetcher all: simplify timestamps to uint64 #19372 (#1318) 2025-08-08 10:33:37 +08:00
filters eth/filters: eth_getLogs fast exit for invalid block range #28386 (#1389) 2025-08-31 15:40:48 +08:00
gasprice all: rename ChainId to ChainID #16853 (#1456) 2025-09-09 22:54:34 +08:00
hooks eth/tracers: live chain tracing with hooks #29189 (#1352) 2025-09-09 17:30:56 +08:00
tracers eth/tracers/js: avoid compiling js bigint when not needed #30640 (#1497) 2025-09-17 08:17:18 +08:00
util feat: add TIPEpochHalving, better style 2025-03-25 22:16:35 +08:00
api.go all: rename ChainId to ChainID #16853 (#1456) 2025-09-09 22:54:34 +08:00
api_backend.go all: fix inconsistent receiver name (#1494) 2025-09-17 08:15:23 +08:00
api_test.go eth/tracers: live chain tracing with hooks #29189 (#1352) 2025-09-09 17:30:56 +08:00
backend.go cmd, eth: rename config and flag to VMTraceJsonConfig #29573 (#1490) 2025-09-13 10:52:31 +08:00
backend_test.go Move consensus hooks to its own package 2021-10-10 16:04:32 +11:00
bloombits.go core, eth, params: make indexer configurable (#17188) 2025-03-10 15:41:53 +08:00
handler.go eth: skip VerifyHeader in traceBlock to fix #1185 (#1265) 2025-07-26 18:18:50 +08:00
handler_test.go Revert EIP-2464 2024-08-24 02:31:27 +07:00
helper_test.go core: move genesis alloc types to core/types (#29003) 2025-01-24 16:54:12 +08:00
metrics.go metrics, cmd/XDC: change init-process of metrics (#30814) 2024-12-13 14:00:14 +08:00
peer.go all: use github.com/deckarep/golang-set/v2 (generic set) (#26159) 2025-01-24 16:54:11 +08:00
protocol.go core: remove unused error from TxPool.Pending (#23720) 2024-11-01 11:36:53 +08:00
protocol_test.go eth: set networkID to chainId by default (#28250) 2025-02-17 09:17:31 +08:00
state_accessor.go eth/tracers: live chain tracing with hooks #29189 (#1352) 2025-09-09 17:30:56 +08:00
sync.go core: remove unused error from TxPool.Pending (#23720) 2024-11-01 11:36:53 +08:00
sync_test.go Revert EIP-2464 2024-08-24 02:31:27 +07:00