lua-users home
lua-l archive

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


On 10 June 2015 at 15:06, Roberto Ierusalimschy <roberto@inf.puc-rio.br> wrote:
>> So the structure looks like this:
>>
>> |------ first 8 bytes ----------| |------- second 8 bytes -------|
>>   value other than double        type code (int) union
>>   including 64-bit int                 with double
>>
> What do you gain here? The standard representation is this:
>
>   |------ first 8 bytes ----------| |------- second 8 bytes -------|
>     any value including double           type code (int)
>     and 64-bit int
>
> It occupies the same space and it is simpler...

Agreed - I was investigating whether in JIT mode performance of
numeric arithmetic (important in benchmarks) would improve by
eliminating the need to set the type code for every double value. I
reported my conclusion that it did not help. Perhaps the cost of
setting/getting values from the Lua stack overwhelms any gains.