Replies: 2 comments
-
It was at least brought up in #512, but Luau has generally not implemented changes that increase the complexity of the VM without specific metrics showing that it would be a net improvement in a Roblox environment. I'm sure the Luau team is aware of the short string optimizations since they're pretty common in other Lua implementations, and they seem to consult those for practices that've worked well for others. A number of features from Lua 5.1 have actually been removed if they increase maintenance burden without a convincing use-case within Roblox, like the emergency garbage collector. I believe Roblox tries to mitigate some of the negative effects of all strings being on the heap by doing things like having fewer VMs (and by extension, heaps) so they can benefit from the VM-level string interning inherent in Lua's heap-allocated strings. |
Beta Was this translation helpful? Give feedback.
-
We do not plan to include divergent string types in our implementation of Luau VM and will not accept PRs with that functionality. |
Beta Was this translation helpful? Give feedback.
-
This could be a compiler flag that introduces 1-2 internal types (or additional state for LUA_TSTRING if there are unused bits.) Strings of sizes 0-11 come to mind, but there could be an additional type for strings of size 12. This could vary based on the size of TValue at compile time.
Reasoning:
Some challenges:
Has this been discussed before?
Beta Was this translation helpful? Give feedback.
All reactions