Skip to content

Commit 69b0b47

Browse files
committed
finish performance note
1 parent 28bc2aa commit 69b0b47

File tree

1 file changed

+19
-9
lines changed

1 file changed

+19
-9
lines changed

doc/source/performance.rst

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,23 +26,33 @@ The following benchmarks show total module loads, import and runtimes. All times
2626
The first benchmark is for a minimal project that uses the settings file generated by
2727
:django-admin:`startproject`. You can see that when :pypi:`rich` is installed several hundred extra
2828
modules must be imported. This adds a few 10s of milliseconds to the import time. To avoid this,
29-
uninstall :pypi:`rich`. As of :pypi:`Typer` 0.17, :pypi:`rich` is lazily loaded, but until certain
30-
improvements are made to :pypi:`Typer`, the import time penalty is still incurred by
31-
:pypi:`django-typer`.
29+
uninstall :pypi:`rich`. As of :pypi:`Typer` 0.17, :pypi:`rich` is lazily loaded, but `until certain
30+
improvements <https://github.com/django-commons/django-typer/issues/170>`_ are made to :pypi:`Typer`
31+
, the import time penalty is still incurred by :pypi:`django-typer`.
3232

33-
.. raw:: html
34-
:file: _static/img/minimal_profile.svg
33+
.. only:: html
34+
35+
.. raw:: html
36+
:file: _static/img/minimal_profile.svg
37+
38+
.. only:: latex
39+
40+
.. image:: _static/img/minimal_profile.svg
41+
:width: 80%
3542

3643
The second benchmark shows the same stats for the :ref:`polls example code <building_commands>`.
3744
These benchmarks compare the :class:`~django.core.management.BaseCommand` native implementation
3845
to the :class:`~django_typer.management.TyperCommand` implementation. They show that the overhead of
3946
using :pypi:`django-typer` is minimal. On the order of a few 10s of milliseconds. Adding
4047
:pypi:`rich` increases this overhead slightly, but the impact is still barely noticeable.
4148

42-
.. raw:: html
43-
:file: _static/img/polls_profile.svg
4449

50+
.. only:: html
51+
52+
.. raw:: html
53+
:file: _static/img/polls_profile.svg
4554

46-
.. success::
55+
.. only:: latex
4756

48-
These benchmarks illustrate that adding
57+
.. image:: _static/img/polls_profile.svg
58+
:width: 80%

0 commit comments

Comments
 (0)