mirror of
https://github.com/luau-lang/luau.git
synced 2025-05-04 10:33:46 +01:00
Update records.md
This commit is contained in:
parent
07e5a6f55a
commit
ed1156a449
1 changed files with 2 additions and 0 deletions
|
@ -24,6 +24,8 @@ to associate methods with table structure in idiomatic OOP in Luau with tables.
|
||||||
3. Runtime overhead. While we heavily optimize table reads and writes in object-like scenario, there's still a non-zero cost that is paid for establishing the mapping
|
3. Runtime overhead. While we heavily optimize table reads and writes in object-like scenario, there's still a non-zero cost that is paid for establishing the mapping
|
||||||
from the index literal to the hash field. Method calls are similarly optimized but the optimization is restricted by the generality of table structure. Finally, large
|
from the index literal to the hash field. Method calls are similarly optimized but the optimization is restricted by the generality of table structure. Finally, large
|
||||||
object size results in higher cache pressure which affects performance.
|
object size results in higher cache pressure which affects performance.
|
||||||
|
4. Strictness of access. Today at runtime, reading an unknown key from the table returns `nil` and writing a new key just works. This creates significant amount of
|
||||||
|
complexity in the type checker, as it has to differentiate between tables that are open for extension and closed via a set of heuristics, and results in easy to make mistakes in untyped code.
|
||||||
|
|
||||||
Today, writing idiomatic objects in Luau is relatively straightforward but making idiomatic OOP type safe or maximally efficient is next to impossible.
|
Today, writing idiomatic objects in Luau is relatively straightforward but making idiomatic OOP type safe or maximally efficient is next to impossible.
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue