From 886323f8acef6212e1e99e7127a36952575a66bd Mon Sep 17 00:00:00 2001 From: R Chintan Meher Date: Thu, 10 Jul 2025 10:24:44 +0530 Subject: [PATCH] #108 #107 #104 Explicitly state on functions does nothing, add parallell=True to docs --- docs/source/reference/Features/OPTIMIZE.rst | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/docs/source/reference/Features/OPTIMIZE.rst b/docs/source/reference/Features/OPTIMIZE.rst index 66824d1..8d037d2 100644 --- a/docs/source/reference/Features/OPTIMIZE.rst +++ b/docs/source/reference/Features/OPTIMIZE.rst @@ -5,21 +5,27 @@ reStructuredPython allows you to apply runtime optimizations using special compi .. code-block:: python - + for i in range(10_000_000) { temp = str(i) * 10 } .. note:: - Optimizations currently support loops and functions only. + Optimizations currently support loops only. The function implementation currently **does not** have actual optimizations, only profiling and tracing. -Arguments for `optimize_loop` and `optimize_function` include: +Arguments for on loops include: - ``gct=True``: Enable garbage collection tracking. - ``profile=True``: Enable execution time logging. +- ``parallel=True``: Enables multiprocessing pool -This will generate a python file that imports the optimization decorators from this ( the ``restructuredpython`` package ), so you will need to have this packag installed via pip on systems running your compiled, optimized program. +Arguments for on functions include: + +- ``profile=False`` Enable execution time logging +- ``trace=False`` Enable event tracing + +This will generate a python file that imports the optimization decorators from this ( the ``restructuredpython`` package ), so you will need to have this package installed via pip on systems running your compiled, optimized program. However, as of 2.5.0, you could technically open the generated python file, remove the imports from ``restructuredpython``, and instead use ``include 'subinterpreter.optimize'``. However, this is expictily NOT recommended as it will break in future versions of reStructuredPython and will include an annoying copyright header in the generated file.