Description
The function compile
has been made to reduce the cost of computations on-chain, and thus the cost of computations in convex coins.
For programs using convex API, precompiling the code is therefore something that should always be done.
Which is why it seems essential that the compile function never increase the cost of computations.
However, it can in a lot of cases, and in every "simple" cases. Compiling off-chain then running it on-chain will make the reader read the command again, and read even more than if it wasn't compiled.
As an exemple, running
(+ 1 2)
costs 1210 coins.
However, compiling it gives
(#50/+ 1 2)
(50 being my address), and running it costs 1930 coins.
Running it with an eval costs even more (3950) as the reader and compiler must now understand the eval
too.