Performance Benchmarks
Relevant source files
The following files were used as context for generating this wiki page:
The @wonderland/walletless library is designed to provide a high-performance, virtual EIP-1193 provider for end-to-end (E2E) testing of Web3 applications. By eliminating the overhead associated with browser extensions and physical wallet interactions, it enables deterministic and rapid test execution.
The primary purpose of these benchmarks is to demonstrate the efficiency gains achieved by using a virtualized "man-in-the-middle" provider compared to traditional E2E testing tools like Synpress. These gains are primarily realized through controlled RPC latency and local transaction signing.
Sources: README.md:1-12, package.json:2-15
Comparative Performance Metrics
The performance of Walletless was measured against Synpress using a standardized test suite. This suite involved connecting a wallet via a RainbowKit modal and executing a 1 ETH transfer on a Next.js boilerplate.
| Metric | Synpress | Walletless | Speedup |
|---|---|---|---|
| Real | 34.50s | 2.10s | 16x |
| User | 24.24s | 2.98s | 8x |
| Sys | 5.34s | 0.75s | 7x |
Sources: README.md:38-48
Architectural Efficiency
The performance advantages of Walletless stem from its specialized architecture, which bifurcates RPC requests into "Read" and "Write" operations to minimize latency.
Execution Flow
- Read Operations: Methods such as
eth_callandeth_getBalanceare forwarded directly to a local Anvil RPC node. - Write Operations: Methods requiring signatures, such as
eth_sendTransactionorpersonal_sign, are handled locally using aviemwalletClient. This avoids the asynchronous delays of browser extension popups.
The diagram shows how the E2E provider intercepts DApp requests to either forward them to Anvil or sign them locally before submission.
Sources: README.md:14-25, src/provider.ts:250-410
Local Implementation vs. External Dependencies
Walletless achieves high performance by being "lightweight" and having zero external dependencies for its core logic, relying solely on viem types and native fetch.
| Component | Implementation Detail | Performance Impact |
|---|---|---|
| RPC Communication | Native fetch API | Low overhead compared to heavy wrapper libraries. |
| Signing | Local PrivateKeyAccount | Instantaneous signing without IPC or extension context switching. |
| Chain Realism | Virtual EIP-1193 | Zero browser extension overhead. |
Sources: README.md:27-36, src/provider.ts:140-160, package.json:52-55
Resource Usage and Environment
The system is optimized for CI/CD environments and headless browsers, where system (Sys) and user (User) CPU time are critical resources.
- Node.js Requirement: Node >= 20.
- Latency Control: The provider allows for "controlled RPC latency" to simulate various network conditions without the unpredictability of public testnets.
- Anvil Integration: By defaulting to
http://127.0.0.1:8545, it leverages the speed of local development nodes.
This sequence illustrates the streamlined path for transaction execution, which is significantly faster than manual or extension-based flows.
Sources: README.md:27-36, src/constants.ts:5-6, package.json:85-87
Conclusion
The benchmarks indicate that @wonderland/walletless offers a significant performance improvement (up to 16x) for E2E testing compared to traditional methods. By virtualizing the wallet interaction layer and communicating directly with local RPC nodes like Anvil, the library provides a high-performance solution suitable for complex, multi-chain testing environments.