mirror of
https://github.com/luau-lang/luau.git
synced 2025-05-04 10:33:46 +01:00
Update performance.md
Also fix math statement while we're at it to be actually correct.
This commit is contained in:
parent
a43ff1e811
commit
b5fc5056c7
1 changed files with 1 additions and 1 deletions
|
@ -88,7 +88,7 @@ For this mechanism to work, function call must be "obvious" to the compiler - it
|
|||
|
||||
The mechanism works by directly invoking a highly specialized and optimized implementation of a builtin function from the interpreter core loop without setting up a stack frame and omitting other work; additionally, some fastcall specializations are partial in that they don't support all types of arguments, for example all `math` library builtins are only specialized for numeric arguments, so calling `math.abs` with a string argument will fall back to the slower implementation that will do string->number coercion.
|
||||
|
||||
As a result, builtin calls are very fast in Luau - they are still slightly slower than core instructions such as arithmetic operations, but only slightly so. The set of fastcall builtins is slowly expanding over time and as of this writing contains `assert`, `type`, `typeof`, `rawget`/`rawset`/`rawequal`, `getmetatable`/`setmetatable`, `tonumber`/`tostring`, all functions from `math` and `bit32`, and some functions from `string` and `table` library.
|
||||
As a result, builtin calls are very fast in Luau - they are still slightly slower than core instructions such as arithmetic operations, but only slightly so. The set of fastcall builtins is slowly expanding over time and as of this writing contains `assert`, `type`, `typeof`, `rawget`/`rawset`/`rawequal`, `getmetatable`/`setmetatable`, `tonumber`/`tostring`, all functions from `math` (except `noise` and `random`/`randomseed`) and `bit32`, and some functions from `string` and `table` library.
|
||||
|
||||
Some builtin functions have partial specializations that reduce the cost of the common case further. Notably:
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue