Source

pypy / pypy / doc / config / opt.rst

The --opt or -O translation option

This meta-option selects a default set of optimization settings to use during a translation. Usage:

translate.py --opt=#
translate.py -O#

where # is the desired optimization level. The valid choices are:

Level Description
--opt=0 all optimizations off; fastest translation (*)
--opt=1 non-time-consuming optimizations on (*)
--opt=size minimize the size of the final executable (*)
--opt=mem minimize the run-time RAM consumption (in-progress)
--opt=2 all optimizations on; good run-time performance
--opt=3 same as --opt=2; remove asserts; gcc profiling (**)
--opt=jit includes the JIT and tweak other optimizations for it

(*): The levels 0, 1 and size use the Boehm-Demers-Weiser garbage collector (Debian package libgc-dev). The translation itself is faster and consumes less memory; the final executable is smaller but slower. The other levels use one of our built-in custom garbage collectors.

(**): The level 3 enables gcc profile-driven recompilation when translating PyPy.

The exact set of optimizations enabled by each level depends on the backend. Individual translation targets can also select their own options based on the level: when translating PyPy, the level mem enables the memory-saving object implementations in the object space; levels 2 and 3 enable the advanced object implementations that give an increase in performance; level 3 also enables gcc profile-driven recompilation.

The default level is 2.

Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.