In the future, when the CLZ opcode https://eips.ethereum.org/EIPS/eip-7939 is added, many algorithms in Solady can be drastically improved upon.
Libraries such as LibBit, LibBytes, LibString, FixedPointMathLib, LibZip can see a dramatic speedup.
CLZ can be the highest impact improvement to accelerate the EVM for the next 2 years:
- More so than transient storage (can be substituted with using warm slots).
- More so than PUSH0 (can be substituted with other 2 gas opcodes).
LibZip.cdCompress will be more widely used to pack storage automatically. This uses CLZ repeatedly.
To enable maximum support and backwards compatibility:
- Once the
CLZ opcode appears on mainnet, the corresponding library will be in the future directory (e.g. utils/future).
- Let's also take the opportunity to introduce stuff like
MCOPY (e.g. for insertion sort).
- When most L2s have the
CLZ opcode, we may decide to move the libraries from future into the actual directory. Then, the non CLZ libraries will be moved into the legacy directory.
In the future, when the
CLZopcode https://eips.ethereum.org/EIPS/eip-7939 is added, many algorithms in Solady can be drastically improved upon.Libraries such as
LibBit,LibBytes,LibString,FixedPointMathLib,LibZipcan see a dramatic speedup.CLZcan be the highest impact improvement to accelerate the EVM for the next 2 years:LibZip.cdCompresswill be more widely used to pack storage automatically. This usesCLZrepeatedly.To enable maximum support and backwards compatibility:
CLZopcode appears on mainnet, the corresponding library will be in thefuturedirectory (e.g.utils/future).MCOPY(e.g. for insertion sort).CLZopcode, we may decide to move the libraries fromfutureinto the actual directory. Then, the nonCLZlibraries will be moved into thelegacydirectory.