Rather than storing lua values as classes we should store our core data type as a struct. It's significantly more performant (with less memory overhead), we can go from 32 bytes -> 16 bytes (using NaN boxing, we always need 16 though because we need an object ref & a unmanaged long int, you can't mix the two in a single object).
Rather than storing lua values as classes we should store our core data type as a struct. It's significantly more performant (with less memory overhead), we can go from 32 bytes -> 16 bytes (using NaN boxing, we always need 16 though because we need an object ref & a unmanaged long int, you can't mix the two in a single object).