A Django performance fix, sharpened by one precise review request.
Short answer
Horilla's breadcrumbs() context processor runs on every rendered page. It loaded every Employee row, and every active Candidate row, as full model objects just to read their IDs, then wrote the list to the session on almost every request. The fix fetches IDs with values_list , builds querysets only in the branch that needs them, and writes to the session only when the list changes. It was merged as PR #1180 and closed issue #1038 .
The problem
Horilla is an open-source HR management system built with Django. Issue #1038 reported high latency in a Locust load test, with some requests taking "even 40 secs".
Root cause
The maintainer summarized it in review: " breadcrumbs() is a context processor, so it runs on every rendered request, and before this change it unconditionally evaluated Employee.objects.all() and Candidate.objects.filter(is_active=True) ...…