> **Can't find what you're looking for?** Use `search_docs` on the docs MCP server at `https://v3.viem.sh/api/mcp` to find what you need.

# Benchmarks

These benchmarks compare high-level operations that power Viem across
versions and engine providers. Lower timings are better.

The following results are single-call durations from an Apple M4 Max running
macOS 26.5.2 and Node.js 25.9.0. The comparison represents Viem 3.0.0-next.2
with Ox 1.2.0 and Viem 2.55.10 with Ox 0.14.33. The fastest result in each
row is bold.

:::benchmarks{.benchmark-table scalar="speedup"}
| Task | `viem@2` | `viem` | `viem/node` | `viem/wasm` | Fastest speedup |
| --- | ---: | ---: | ---: | ---: | ---: |
| Decrypt JSON Keystore | 5.9 µs | 4.7 µs | 5.2 µs | **2.4 µs** | 2.5× |
| Derive CREATE2 Contract Address | 14.7 µs | 11.4 µs | 11.6 µs | **6.8 µs** | 2.2× |
| Derive Mnemonic Private Key | 7.26 ms | 7.34 ms | **1.82 ms** | 3.04 ms | 4.0× |
| Encode Event Topics | 4.5 µs | 3.3 µs | 3.3 µs | **1.0 µs** | 4.7× |
| Encode RLP Struct | 257.0 ns | 118.5 ns | 118.9 ns | **117.6 ns** | 2.2× |
| Encode Seaport Fulfill Order (cached) | 13.4 µs | 7.4 µs | 7.3 µs | **7.2 µs** | 1.9× |
| Encode Seaport Fulfill Order (dynamic) | 39.5 µs | 29.3 µs | 28.4 µs | **24.1 µs** | 1.6× |
| Encode Uniswap V2 Swap (cached) | 1.72 µs | 1.08 µs | **1.07 µs** | 1.19 µs | 1.6× |
| Encode Uniswap V2 Swap (dynamic) | 8.8 µs | 6.9 µs | 6.7 µs | **4.2 µs** | 2.1× |
| Generate Random Private Key | 1.61 µs | **1.47 µs** | 1.51 µs | 1.54 µs | 1.1× |
| Get Personal Message Sign Payload | 4.9 µs | 3.4 µs | 3.4 µs | **1.0 µs** | 4.8× |
| Get Transaction Sign Payload | 5.6 µs | 3.9 µs | 4.0 µs | **1.5 µs** | 3.6× |
| Hash 32-byte Payload | 3.55 µs | 2.59 µs | 2.60 µs | **343 ns** | 10.4× |
| Hash Typed Data | 70.3 µs | 52.0 µs | 52.5 µs | **20.0 µs** | 3.5× |
| Recover Secp256k1 Public Key | 1.05 ms | 1.10 ms | 1.10 ms | **36.6 µs** | 28.8× |
| Sign Secp256k1 Message | 178.6 µs | 172.6 µs | 171.9 µs | **24.2 µs** | 7.4× |
| Verify Secp256k1 Signature | 1.83 ms | 963.1 µs | 965.0 µs | **31.3 µs** | 58.3× |
:::

## Method

Run the comparison from the [Ox repository](https://github.com/wevm/ox):

```sh
pnpm bench:comparison --run
```
