Skip to content

Instantly share code, notes, and snippets.

View mdbenito's full-sized avatar
🫥

Miguel de Benito Delgado mdbenito

🫥
View GitHub Profile
@kamilkrzyskow
kamilkrzyskow / performance_debug.py
Last active April 3, 2025 15:50
MkDocs hook for performance debugging
"""MkDocs hook for performance debugging
The idea behind it is to provide a minimal curated performance log for a `mkdocs build` run.
Of course anyone can use a proper profiler, but the output often contains a lot of non-critical data
that the user has to first filter to get a clearer picture. This hook takes care of this and allows
to quickly see where a bottleneck is occurring. It also has a lower overhead than a proper profiler.
It creates a file in the current working directory, it can be configured easily with variables set
at the bottom of the file. There are also the timing categories included.