Skip to content
Commit ee86bf24 authored by Alex Gaynor's avatar Alex Gaynor Committed by Tim Graham
Browse files

[1.8.x] Optimized allow_lazy() by not generating a new lazy wrapper on each invocation.

This dramatically improves performance on PyPy. The following benchmark:

python -mtimeit -s "from django.utils.functional import allow_lazy; from django.utils.translation import ugettext_lazy; f = allow_lazy(lambda s: s, str)" "f(ugettext_lazy('abc'))"

goes from 390us per loop to 165us.

Backport of 82e0cd15 from master
parent b44a56c3
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment