go-ethereum/eth/tracers/js
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
..
internal/tracers eth/tracers: fix typos in comments #28881 (#1346) 2025-09-09 16:16:26 +08:00
bigint.go eth/tracers: package restructuring #23857 (#1266) 2025-08-29 05:26:36 +08:00
goja.go eth/tracers/js: avoid compiling js bigint when not needed #30640 (#1497) 2025-09-17 08:17:18 +08:00
tracer_test.go eth/tracers/js: add coinbase addr to ctx #30231 (#1484) 2025-09-13 10:49:17 +08:00