/fast

Enables faster program execution.

/fast[+ | -]

Arguments

  • +| -
    /fast is on by default. /fast or /fast+ causes the compiler to generate an output file that is speed-optimized, however, if this option is used certain language features from previous versions will not be supported. Specifying /fast-, on the other hand, will provide for backward language compatibility, but the compiler will produce an output file that is not optimized for speed.

Remarks

When /fast is in effect,

  • All variables must be declared.

  • Functions become constants and you cannot assign to them or redefine them.

  • Predefined properties of built-in objects are marked DontEnum, DontDelete, ReadOnly.

  • Properties on the built-in objects may not be expanded, other than the Global object (which is also the global scope).

  • The arguments variable is not available within function calls.

  • Assignments to read-only variables, fields, or methods generate errors.

    Note

    The /fast- compilation mode is provided to help developers build standalone executables from legacy JScript code. When developing new executables or libraries, use the /fast+ compilation mode. This ensures better performance and better compatibility with other assemblies.

    Security noteSecurity Note

    The /fast- compilation mode enables the use of language features from previous versions not available in /fast+ mode. Misuse of these features can result in a program with weaker security. For more information, see Security Considerations for JScript.

Example

Create an output file that is speed-optimized at the expense of full backward language compatibility:

jsc test.js

See Also

Concepts

Security Considerations for JScript

Other Resources

JScript Compiler Options