Summary
The MinimalEvm Frame uses AutoHashMap(u32, u8) for EVM memory, requiring a hash lookup for every single byte access. This is orders of magnitude slower than necessary.
Location
mini/src/frame.zig:50-51
Current Code
memory: std.AutoHashMap(u32, u8),
memory_size: u32,
Problem
- Each byte read/write requires hash computation and lookup
- No cache locality - bytes are scattered in memory
- Memory expansion requires inserting each byte individually
- Significantly slower than the performance EVM's ArrayList approach
Impact
- Poor performance for memory-intensive operations (MLOAD, MSTORE, MCOPY, KECCAK256)
- Increased memory overhead (HashMap metadata per byte)
- Makes the "mini" EVM unsuitable even for simple benchmarking
Recommended Fix
Replace with std.ArrayList(u8) like the performance EVM:
memory: std.ArrayList(u8),
This provides:
- O(1) indexed access
- Contiguous memory for cache efficiency
- Efficient bulk operations
Note: This issue was created by Claude AI assistant during code review, not @roninjin10 or @fucory
Summary
The MinimalEvm Frame uses
AutoHashMap(u32, u8)for EVM memory, requiring a hash lookup for every single byte access. This is orders of magnitude slower than necessary.Location
mini/src/frame.zig:50-51Current Code
Problem
Impact
Recommended Fix
Replace with
std.ArrayList(u8)like the performance EVM:This provides:
Note: This issue was created by Claude AI assistant during code review, not @roninjin10 or @fucory