django-scribbler icon indicating copy to clipboard operation
django-scribbler copied to clipboard

Template rendering performance

Open PetrDlouhy opened this issue 4 years ago • 1 comments

I just realised, that if I delete all scribbles from my template, the template rendering times are 100-300 ms shorter (measured by https://pypi.org/project/django-debug-toolbar-template-profiler/ with user logged off). This is significant performance issue for me, since it can be 1/3 or more of the whole request time.

I will investigate this further.

PetrDlouhy avatar Nov 17 '20 16:11 PetrDlouhy

I have gone a bit further with the investigation. I find out, that the biggest hurdle is getting the cache key (https://github.com/caktus/django-scribbler/blob/master/scribbler/templatetags/scribbler_tags.py#L54). This single command lasts 30-50ms for every scribble on the page, even thou the cache debug toollbar measures that getting the cache key to ~0.5ms.

I use Redis cache backend.

Sorry, that was false lead - the delay was caused by the cache debug toolbar.

PetrDlouhy avatar Nov 19 '20 12:11 PetrDlouhy