#33098: Micro-optimisation for functional.keep_lazy for single argument uses.
-------------------------------------+-------------------------------------
Reporter: Keryn Knight | Owner: Keryn
Type: | Knight
Cleanup/optimization | Status: assigned
Component: Template system | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Keryn Knight):
PR is here: https://github.com/django/django/pull/14849
Currently waiting to see if a new revised version works, because it's too
hot here at the moment, and there's a couple of problems with the variant
proposed upthread. Most notably, checking for `'func_first_param_name' in
kwargs` like a fool, but also additionally handling funcs which themselves
declare `*args` or `**kwargs`.
Performance remains roughly the same for single argument functions, unless
they're using the kwarg form, in which case it's something like:
{{{
In [3]: %timeit escape(text='<abc>d&g</abc>')
1.89 µs ± 73.6 ns per loop (mean ± std. dev. of 7 runs, 1000000 loops
each)
}}}
Ain't done any tests for it yet, because I shudder at the thought, knowing
that they'll probably require using mock, and there's definitely little
point doing them if the ticket doesn't have merit :)
--
Ticket URL: <https://code.djangoproject.com/ticket/33098#comment:1>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/067.cdae1f79d7beb8d1e59e20b071dbac3f%40djangoproject.com.