ECMAScript proposal: "use slow" directive. #4
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
ECMAScript proposal: The "use slow" Directive
Motivation
"use slow";
defines that code should be executed slowly.Basic performance decrease: x 2.
Declaring
"use slow";
Must be declared in a Directive PrologueAt the beginning of a script:
At the beginning of a function:
"use slow";
affects only the function in which it is declared.Usage
Use slow can be be more than once. Slowdown effect is multiplied. Example:
Use slow inside the function takes effect from the outside code or function: