Zilliqa / scilla-compiler

Compile Scilla to LLVM-IR
GNU General Public License v3.0
8 stars 4 forks source link

Profile the compiler #41

Open vaivaswatha opened 4 years ago

vaivaswatha commented 4 years ago

All the focus so far has been on the performance of the compiled code. Little attention has been paid to how fast the compiler itself runs. To be of practical use, the compiler overhead must be small enough that the benefits of time saved in running the (faster) compiled code is achieved within a few runs (assuming that the compiler runs only once during deployment and the compiled code is cached).

To achieve this, we first need to measure the current compile times and see where we're spending a lot of time. More Issues can be opened (as we progress) to fix different parts of the compiler for efficiency.

vaivaswatha commented 3 years ago

A compilation of the ud-registry.scilla to LLVM bitcode time bin/scilla-llvm -gaslimit 10000 -libdir src/stdlib/ tests/codegen/contr/ud-registry.scilla -o ud-registry.bc takes about ~75ms.

So we're doing decently well for typical contracts. Need to be careful with contracts that have heavy use of polymorphic code.