From 56c7fb507d44b20e7dbe84225a207eecb2c7881e Mon Sep 17 00:00:00 2001 From: Vyacheslav Egorov Date: Wed, 1 Jun 2022 18:28:16 +0300 Subject: [PATCH] Drop Autocomplete improvements and extend compiler optimization section In the cross-post to Roblox developer forum, Autocomplete section will be restored, while compiler optimization section can be optionally removed (although it might interest some developers) --- docs/_posts/2022-06-01-luau-recap-may-2022.md | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/docs/_posts/2022-06-01-luau-recap-may-2022.md b/docs/_posts/2022-06-01-luau-recap-may-2022.md index be529579..4e5bc252 100644 --- a/docs/_posts/2022-06-01-luau-recap-may-2022.md +++ b/docs/_posts/2022-06-01-luau-recap-may-2022.md @@ -67,16 +67,6 @@ function foo(x: T, y) end We have also fixed various issues that have caused crashes, with many of them coming from your bug reports. -## Autocomplete improvements - -Studio autocomplete has received a few improvements: - -* Function argument names have been added to the function signature display -* `Instance:GetAttribute` and `Instance:SetAttribute` will now suggest attribute names if instance can be resolved -* Inside the new if-then-else expression, incorrect suggestions following `else` have been fixed -* Deprecated lowercase `Color3:toHSV` so it's no longer suggested -* Deprecated lowercase `Instance:findFirstChild`, `Instance:clone`, `Instance:remove`, `Instance:getChildren` and old alias called `Instance:children`. - ## Linter improvements `global-used-as-local` lint warning has been extended to notice when global variable writes always happen before their use in a local scope, suggesting that they can be replaced with a local variable: @@ -96,5 +86,10 @@ end Garbage collection CPU utilization has been tuned to further reduce frame time spikes of individual collection steps and to bring different GC stages to the same level of CPU utilization. -In open-source release of Luau, when optimization level 2 is enabled, compiler will now perform function inlining. -Loop unrolling in optimization level 2 has also been improved to handle all language constructs inside the loop body. +### Function inlining and loop unrolling + +In open-source release of Luau, when optimization level 2 is enabled, compiler will now perform function inlining and loop unrolling. + +Only loops with loop bounds known at compile time, such as `for i=1,4 do`, can be unrolled. The loop body must be simple enough for the optimization to be profitable; compiler uses heuristics to estimate the performance benefit and automatically decide if unrolling should be performed. + +Only local functions (defined either as `local function foo` or `local foo = function`) can be inlined. The function body must be simple enough for the optimization to be profitable; compiler uses heuristics to estimate the performance benefit and automatically decide if each call to the function should be inlined instead. Additionally recursive invocations of a function can't be inlined at this time, and inlining is completely disabled for modules that use `getfenv`/`setfenv` functions.