Skip to content

Instantly share code, notes, and snippets.

View kamilkrzyskow's full-sized avatar

Kamil Krzyśków kamilkrzyskow

  • Poland
  • 08:23 (UTC +02:00)
View GitHub Profile
@kamilkrzyskow
kamilkrzyskow / performance_debug.py
Last active May 17, 2024 13:54
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.