Description
Bun is a drop in JavaScript replacement that may be able to greatly improve the performance of ethereumjs. The downside is it is much less stable than Node. This is somewhat mitigated by the Bun team being relatively fast to fix bugs when given a minimal reproducable example.
Caveats
I do not recomend using bun for the package manager. I use Bun myself in evmts and though it works i have ran into a lot of issues related to using Bun install in a monorepo. It's not too bad but I would generally recomend this repo sticks with npm (or pnpm) for now.
I do not recomend using bun as test runner over vitest. It's useful as a test runner for simple packages but vitest is much more feature complete. You can however speed up vitest via running it with bun.
Example using bun
My EVMts currently is using the EVM package from ethereumjs and it is working great:
Tasks
These are the tasks I could do to contribute this feature in order:
- Add example usage of running ethereumjs with bun
- Add benchmark comparisons
- Add bun to root level package.json and migrate some of the developer scripts to use bun as runtime
- Add to CI. Run tests in a matrix vs both node and bun