Hard reload re-reads every plugin template folder for every template (O(plugins²) stat calls)
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 25/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Stale
- Tech stack
- python
- Domain
- backend, performance
Research direction
Start by reading _process_template_config() and compare its template candidate handling with the linked commit, which describes a fix. Reproduce a hard reload and measure statx calls with the issue's strace command; done means the resolved path is checked without probing every plugin template folder.
Written by the indexing model from the issue text.
Description
The problem
On every hard reload OctoPrint performs ~13k stat calls on files that cannot exist.
_process_template_config() prefixes the template candidate with the plugin's
template folder key, so data["template"] is e.g.
navbartemp/navbartemp_navbar.jinja2 and can only exist in that one folder. The
existence check still walks the whole loader chain, statting every plugin template
folder and raising a TemplateNotFound for each. With 21 plugins that is 21 probes ×
~30 template types × 21 folders per rebuild, and a rebuild runs on every request
carrying Cache-Control: no-cache, i.e. every hard reload.
strace -c -f -e trace=statx around a single reload on a Pi 2 with 21 plugins:
27568 statx, 26143 ENOENT (94.9%)
GET / app time (Server-Timing): ~3.1s on the hard reload path, ~200ms normally.
Fix (stat the resolved path instead of probing every folder), after: ~600 statx,
no failing probes:
https://github.com/davtur19/OctoPrint/commit/c963f02dae6bfc3ef7130a4cc3bff0fd1aef2615
Did the issue persist even in safe mode?
Yes, it did persist
If you could not test in safe mode, please state why ("currently printing" is NOT an excuse!)
No response
Version of OctoPrint
1.11.8
Operating system running OctoPrint
octopi
Browser and version of browser, operating system running browser
No response
Printer model & used firmware incl. version
No response
Systeminfo Bundle
octoprint-systeminfo-20261031014254.zip[^bundle1]
Checklist of files to include below
- Contents of the JavaScript browser console (always include in cases of issues with the user interface)
- Screenshots and/or videos showing the problem (always include in case of issues with the user interface)
- GCODE file with which to reproduce (always include in case of issues with GCODE analysis or printing behaviour)
Additional information & file uploads
No response
[^bundle1]: octoprint-systeminfo-20261031014254.zip (bundleviewer) (download)
OctoPrint: 1.11.8
Python: 3.11.2
OS: Linux-6.12.96+rpt-rpi-v7-armv7l-with-glibc2.36
RPi: Raspberry Pi 2 Model B Rev 1.1
OctoPi: 1.1.0 (build 2025.05.13.134411)
Browser:
- Dominant language
- Python
- Stars
- 9.2k
- Forks
- 1.7k
- Avg merge
- 6d 8h
- Merged PRs (30d)
- 6
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from OctoPrint/OctoPrint
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
-
triage
Difficulty 3/5 1-2 days Newbie friendliness 55/100
-
triage
Difficulty 3/5 1-2 days Newbie friendliness 56/100
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 56/100
-
request
Difficulty 4/5 3-5 days Newbie friendliness 45/100
All issues in OctoPrint/OctoPrint
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
abetlen/llama-cpp-python#2424 ·
Maintainers usually reply within 1 day
-
Bug IronPython Python 3
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
pyrevitlabs/pyRevit#4184 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 74/100
jqueryscript/awesome-claude-code#1009 ·
-
tests
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
Maintainers usually reply within 3 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day