mirror of
https://github.com/simonw/datasette.git
synced 2026-10-31 23:47:38 +01:00
Tools for profiling Datasette's request/response cycle in-process with Python 3.15's profiling.sampling, plus the patches proposed by the study (one per optimisation, and ALL-combined.diff). The patches are not applied to the code. A report with measurements follows. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01F8mEgRS8swZfYqwqrVMeo5
15 lines
772 B
Diff
15 lines
772 B
Diff
diff --git a/datasette/templates/base.html b/datasette/templates/base.html
|
|
index 1c5b833..cff9c82 100644
|
|
--- a/datasette/templates/base.html
|
|
+++ b/datasette/templates/base.html
|
|
@@ -34,8 +34,8 @@
|
|
{% endblock %}
|
|
|
|
<section class="content">
|
|
-{% block content %}
|
|
-{% endblock %}
|
|
+{# Rendering into a variable and outputting it once is much faster than yielding every fragment up through the async block/extends generators. The with block keeps content_html out of the template context, so it cannot shadow a content_html variable used by later blocks #}{% with %}{% set content_html %}{% block content %}
|
|
+{% endblock %}{% endset %}{{ content_html }}{% endwith %}
|
|
</section>
|
|
</div>
|
|
<footer class="ft">{% block footer %}{% include "_footer.html" %}{% endblock %}</footer>
|