Issue1858

classification
Title: Jinja slow on jython
Type: Severity: normal
Components: Versions:
process
Status: closed Resolution: wont fix
Dependencies: Superseder:
Assigned To: Nosy List: fwierzbicki, ssteiner
Priority: Keywords:

Created on 2012-03-20.16:42:26 by ssteiner, last changed 2013-02-26.18:29:51 by fwierzbicki.

Messages
msg6923 (view) Author: simon steiner (ssteiner) Date: 2012-03-20.16:42:26
import jinja2
import time
astr = '{% for a in [] -%}{%- endfor %}' * 100
start_time = time.time()
env = jinja2.Environment()
template = env.from_string(astr)
print "Script runtime duration: %s seconds" % (time.time() - start_time)

python testjinja.py
Script runtime duration: 0.0939998626709 seconds

java -jar jython.jar testjinja.py
Script runtime duration: 1.06200003624 seconds
msg6924 (view) Author: simon steiner (ssteiner) Date: 2012-03-20.16:47:32
import jinja2
import time
astr = '{% for a in [] -%}{%- endfor %}' * 300
start_time = time.time()
env = jinja2.Environment()
template = env.from_string(astr)
print "Script runtime duration: %s seconds" % (time.time() - start_time)

java -jar jython.jar testjinja.py
Script runtime duration: 5.15700006485 seconds

python testjinja.py
Script runtime duration: 0.235000133514 seconds
msg7800 (view) Author: Frank Wierzbicki (fwierzbicki) Date: 2013-02-26.18:29:50
Not sure there is much to be done for this in the near future. Possibly in 3.x we will start to focus on perf with invokedynamic.
History
Date User Action Args
2013-02-26 18:29:51fwierzbickisetstatus: open -> closed
resolution: wont fix
messages: + msg7800
nosy: + fwierzbicki
2012-03-20 16:47:32ssteinersetmessages: + msg6924
2012-03-20 16:42:26ssteinercreate