warp icon indicating copy to clipboard operation
warp copied to clipboard

Cairo Generated Function Inlining

Open rodrigo-pino opened this issue 2 years ago • 0 comments

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 memory and storage
  • 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).

rodrigo-pino avatar Jan 16 '23 21:01 rodrigo-pino