﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
36705	Repeated string concatenation is slow on some python implementations, in particular PyPy	Jacob Walls	Varun Kasyap Pentamaraju	"There is a [https://pypy.org/posts/2023/01/string-concatenation-quadratic.html known limitation] in PyPy that repeated string concatenation is slow. The discussion there observes that CPython has an optimization, but it's fragile and best not relied on.

Seokchan Yoon (thanks for the report!) raised this with the security team, and we decided any hardening here could be done in public.

To close this ticket, we should:
- implement targeted optimizations in django.utils.numberformat.format() to avoid repeated string concatenation
- audit for other similar cases
- Add a disclaimer to our [https://docs.djangoproject.com/en/5.2/topics/performance/#id1 documentation] around PyPy, for example, wording like:

> That said, a lot of a web framework's work is done by concatenating strings, and PyPy has an issue with that (see https://pypy.org/posts/2023/01/string-concatenation-quadratic.html). This may cause performance issues, depending on your use."	Cleanup/optimization	closed	Utilities	dev	Normal	fixed	PyPy		Ready for checkin	1	0	0	0	0	0
