Open enitrat opened 11 months ago
Important update: we are gathering some bugs in the Kakarot v0 codebase, we need to make sure each issue and each PR in Kakarot-ssj is aware of the lists of known bugs. Look at this link everytime you take an issue and check your issue isn't targeted by a known bug.
Important update: we are gathering some bugs in the Kakarot v0 codebase, we need to make sure each issue and each PR in Kakarot-ssj is aware of the lists of known bugs. Look at this tracking issue everytime you take an issue and check your issue isn't targeted by a known bug. Will add this reminder in many places to make sure we keep track of known bugs.
Description
Memory is one of the core elements of the EVM. Having it as optimized as possible would reduce the overall costs of all transactions ran through the EVM.
Here is my proposal: We can refactor the memory to be 32-bytes words based instead of the current 16-bytes words based implementation.
I started to implement the new version to run some benchmarks. Below are the related code snippets.
16-bytes words memory (current implementation)
32-bytes words memory (optimisation proposal)
Benchmarks
I ran tests on both implementations and computed the actual gas usage of both functions. Here is the output
This leads to a ~4% gas decrease for each
store
operationProposal
Replace the 16-bytes words implementation with the 32-bytes words one.