warp
warp copied to clipboard
Cairo Generated Function Inlining
To mimic part of Solidity's behaviour, Warp generates some functions with multiple purposes: from reading and writing to memory/storage to encoding following the abi specifications. The code base dedicated to handle this issue is located in src/cairoUtilFuncGen.
Some of this functions are really simple and get called a lot, producing a performance overhead due to excessive calling. The goal is to inline these functions inside the body of the function which calls it. Proposed functions to inline:
- Functions which write to
memoryandstorage - Functions which copy elements from different storage types (
storage,memory,calldata)
Also, generated functions which have variable size should have a mechanism to be inline according to it's size (e.g. a functions which writes to storage a static array of size 3 can be inlined without affecting readability but one of size 100 cannot).