From 14e4b0e110ca60f06faff3e2e74d1de9791a2504 Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Sun, 22 Jan 2023 11:01:14 +0100 Subject: [PATCH] Document using Pyston-lite for faster builds on macOS --- .../compiling/compiling_for_linuxbsd.rst | 7 +++++++ .../compiling/compiling_for_macos.rst | 16 ++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/contributing/development/compiling/compiling_for_linuxbsd.rst b/contributing/development/compiling/compiling_for_linuxbsd.rst index 42d73f71d..f8e0d172f 100644 --- a/contributing/development/compiling/compiling_for_linuxbsd.rst +++ b/contributing/development/compiling/compiling_for_linuxbsd.rst @@ -284,3 +284,10 @@ to get even faster builds. If you can't run ``pyston-scons`` after creating the symbolic link, make sure ``$HOME/.local/bin/`` is part of your user's ``PATH`` environment variable. + +.. note:: + + Alternatively, you can run ``python -m pip install pyston_lite_autoload`` + then run SCons as usual. This will automatically load a subset of Pyston's + optimizations in any Python program you run. However, this won't bring as + much of a performance improvement compared to installing "full" Pyston. diff --git a/contributing/development/compiling/compiling_for_macos.rst b/contributing/development/compiling/compiling_for_macos.rst index c58fd4b18..a3eb62352 100644 --- a/contributing/development/compiling/compiling_for_macos.rst +++ b/contributing/development/compiling/compiling_for_macos.rst @@ -172,6 +172,22 @@ template from the official Godot distribution:: zip -q -9 -r macos.zip macos_template.app +Using Pyston for faster development +----------------------------------- + +You can use `Pyston `__ to run SCons. Pyston is a +JIT-enabled implementation of the Python language (which SCons is written in). +Its "full" version is currently only compatible with Linux, but Pyston-lite is +also compatible with macOS (both x86 and ARM). Pyston can speed up incremental +builds significantly, often by a factor between 1.5× and 2×. Pyston can be +combined with alternative likers such as LLD or Mold to get even faster builds. + +To install Pyston-lite, run ``python -m pip install pyston_lite_autoload`` then +run SCons as usual. This will automatically load a subset of Pyston's +optimizations in any Python program you run. However, this won't bring as much +of a performance improvement compared to installing "full" Pyston (which +currently can't be done on macOS). + Cross-compiling for macOS from Linux ------------------------------------