Is it possible speed up loops in template using Cython, PyPy or Numba?
{% for student in [p for p in people if p.student and p.age > 23] %}
<li>{{ escape(student.name) }}</li>
{% end %}
My intent is try out if loops can made faster for template rendering purpose.
Something in Numba can be tried out like
def python_sum(y):
N = len(y)
x = y[0]
for i in xrange(1,N):
x += y[i]
return x
numba_sum = autojit()(python_sum)
numba_sum.func_name = "numba_sum"
If tried to pass the template as a function, it fails.
File "C:\Python27\lib\site-packages\numba\dispatcher.py", line 123, in _compile_and_call assert not kws AssertionError ; error throws up when I call the template as function