You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Refs django-commons#910 - After Django introduced template based widget rendering, the number of context values which need prettifying has increased drastically, which can (given enough template contexts to render) cause pages using the template panel to become essentially unresponsive due to the sheer amount of data.
Instead, when first seeing a new context layer, attempt to render it as a string (a key) and store that + the pretty output (the value) into a dictionary, and when subsequently seeing the same string (ie: individual iterations of a Select widget) key, use the existing pretty output instead of re-rendering it.
This cuts the number of pformat calls at a minimum by half, and ultimately (far) more than that due to re-use of the same one where possible.
0 commit comments