lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


> Lua 5.4  optimize small constant integer ADD by OP_ADDI , and a bit slower
> for big constants.
> 
> You can change those big integers to small one and test again, you will
> find much faster.

That is correct. When choosing the new opcodes, we did some measures of
occurrences of some kinds of operands for some operations over a big
corpus of Lua files. We found that occurrences of additions with "big"
integer constants (actually anything larger than 2) and additions with
any float constant are very rare and therefore it is not worth to have
specific opcodes for those cases.

If these hypotheses are wrong, we will be happy to learn about and
rework our set of opcodes.

-- Roberto