Performance

How obfuscation affects script execution speed and file size.


Obfuscation increases execution time and file size. The engine provides settings to balance security and speed.

Optimization Levels

The engine groups obfuscation techniques into three profiles. Higher levels increase execution time and output file size.

  • Safe (Level 1): The fastest profile. Applies constant folding and jump merging. Use this for standard workloads.
  • Aggressive (Level 2): Applies constant propagation and enables Intense VM Structure for the Luau backend. Execution is slower.
  • Maximized (Level 3): The slowest profile. Enforces global constant folding and global import localization. Use this only when security overrides all performance concerns.

VM Intensity and Size

Intense VM Structure

When you enable Intense VM Structure (or select Aggressive/Maximized), the compiler adds layers to the bytecode emulator. This prevents de-virtualization tools from analyzing the VM structure. It does not significantly affect execution speed, but it increases the final file size. Because of structural changes, this feature requires disabling line information, meaning stack traces will lose their original line numbers.

VM Compression

The VM Compression setting uses a proprietary algorithm to reduce the obfuscated file size.

  • Benefit: Reduces the bytes sent over the network or stored on disk.
  • Drawback: Adds processing time during script initialization. The execution speed of the script after it loads remains unchanged.

Minimizing Overhead

If your obfuscated code runs too slowly, apply these changes:

  1. Select an accurate target. Do not use a generic target if a specific one exists. The Luau VM backend optimizes specifically for Luau, while the Portable Lua backend targets generic AST limits.
  2. Disable Line Information. The engine wraps functions in a custom error handler to preserve line numbers. Setting disableLineInformation to true removes this wrapper. The script runs faster, but error messages drop line numbers.
  3. Use Static Environment. If your code never calls setfenv, enable Static Environment. This allows the compiler to remove internal environment-checking instructions.
  4. Hardcode Globals. For Roblox or World of Warcraft targets, enabling Hardcode Globals injects global variables directly into the VM. This speeds up read and write operations. The names of the globals remain visible in the obfuscated file.
  5. Exclude rendering logic. Do not obfuscate rendering loops, 3D math routines, or UI event handlers (RenderStepped, Heartbeat). The overhead of emulating these instructions causes frame drops. Isolate performance-critical code into unobfuscated modules.