Skip to content

Commit 61453d4

Browse files
committed
update index.rst
1 parent 3652a58 commit 61453d4

File tree

1 file changed

+0
-83
lines changed

1 file changed

+0
-83
lines changed

docs/index.rst

-83
Original file line numberDiff line numberDiff line change
@@ -31,28 +31,6 @@ CLI
3131
compile
3232
=================
3333

34-
+-------------------+--------------------------------------------------+
35-
| Syntax | Description |
36-
+===================+==================================================+
37-
| ``-- | by default it excludes any ``test`` and |
38-
| input-path PATH`` | ``__init__.py`` files |
39-
+-------------------+--------------------------------------------------+
40-
| ` | Deletes the sources files. |
41-
| `--clean-source`` | |
42-
+-------------------+--------------------------------------------------+
43-
| ``--keep-builds`` | Keeps the temp build files. |
44-
+-------------------+--------------------------------------------------+
45-
| ``--cl | Deletes the shared objects (``.so``) files. |
46-
| ean-executables`` | |
47-
+-------------------+--------------------------------------------------+
48-
| ``--engine`` | Can be ``cython`` or ``nuitka``. |
49-
+-------------------+--------------------------------------------------+
50-
| ``--exc | Glob file patterns for excluding specific files. |
51-
| lude-glob-paths`` | |
52-
+-------------------+--------------------------------------------------+
53-
| ``--verbose`` | Increase log messages. |
54-
+-------------------+--------------------------------------------------+
55-
5634
.. code:: bash
5735
5836
pycompile -i your_python_files --clean-source --engine nuitka
@@ -73,9 +51,6 @@ files.
7351
7452
pycompile -i input_path --engine nuitka
7553
76-
77-
78-
7954
After the compilation the ``input`` dir will have the following
8055
structure.
8156

@@ -91,76 +66,18 @@ structure.
9166
Benchmark
9267
~~~~~~~~~
9368

94-
+-----------------------+----------------------------------------------+
95-
| Syntax | Description |
96-
+=======================+==============================================+
97-
| ``--input-path PATH`` | by default it excludes any ``test`` and |
98-
| | ``__init__.py`` files |
99-
+-----------------------+----------------------------------------------+
100-
| ``--engine`` | Can be ``cython``, ``nuitka``, ``all`` or |
101-
| | ``none``. |
102-
+-----------------------+----------------------------------------------+
103-
| ``--type`` | Can be ``memory`` , ``cpy``, or ``both`` |
104-
+-----------------------+----------------------------------------------+
105-
| ``--verbose`` | Increase log messages. |
106-
+-----------------------+----------------------------------------------+
107-
| ``--profil | function name pattern for profiling defaults |
108-
| e_func_pattern TEXT`` | to ``benchmark`` |
109-
+-----------------------+----------------------------------------------+
110-
11169
For running a benchmark on the ``input-path`` use the following command:
11270

11371
.. code:: bash
11472
11573
pycompile benchmark -i src/examples -vvv
11674
117-
which by default will start a ``memory`` and a ``cpu`` benchmark,
118-
starting with ``python`` and then with ``cython`` and ``nuitka``
119-
The python package must have a ``test_module.py`` because both benchmark
120-
types are invoked with ``pytest`` runs
121-
122-
- For **memory profiling** the script will decorate all the functions
123-
in ``benchmark.py`` with the ``profile`` decorator from
124-
``memory-profiler``. This is not optimal memory profiling, because we
125-
don’t actually ``profile`` the function itself, instead we profile
126-
the ``caller`` but it’s necessary if we want to ``profile`` also the
127-
compiled code. Use the ``profile_func_pattern`` to specify the
128-
function to be profiled in different module for example if ``main``
129-
is the entrypoint under ``main.py`` use
130-
``--profile_func_pattern main``.
131-
132-
Hence, the following structure are required for the ``benchmark``
133-
subcommand.
134-
135-
- For **cpu profiling** the same approached is being used, but instead
136-
of decorating the ``calling functions`` it ``decorates`` the test
137-
cases with the ``benchmark`` from ``pytest-benchmark``.
138-
139-
.. code:: text
140-
141-
module
142-
├── sample_funcs.py # implementation
143-
├── main.py # entrypoint with a `main` function
144-
├── test_sample_funcs.py # test cases
145-
14675
14776
14877
14978
Dry run
15079
~~~~~~~
15180

152-
+-------------------+--------------------------------------------------+
153-
| Syntax | Description |
154-
+===================+==================================================+
155-
| ``-- | by default it excludes any ``test`` and |
156-
| input-path PATH`` | ``__init__.py`` files |
157-
+-------------------+--------------------------------------------------+
158-
| ``--exc | Glob file patterns for excluding specific files. |
159-
| lude-glob-paths`` | |
160-
+-------------------+--------------------------------------------------+
161-
| ``--verbose`` | Increase log messages. |
162-
+-------------------+--------------------------------------------------+
163-
16481
.. code:: bash
16582
16683
pycompile dry_run -i ./src

0 commit comments

Comments
 (0)