youtube / spitfire

A high-performance Python template language
BSD 3-Clause "New" or "Revised" License
404 stars 58 forks source link

Enhancement patch: Up to 20% compile speed improvements #9

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
In my application (with a deeply nested hierarchy of templates), this patch 
provides a 20% and up improvement to compile times by caching pattern lists, 
and speeding up restriction checks.  Testing speed against the included tests 
provides a more modest 5% speedup.

Original issue reported on code.google.com by dou...@google.com on 25 May 2011 at 9:02

Attachments:

GoogleCodeExporter commented 8 years ago
Thanks. I made a few changes and brought that from ~20% to ~28% faster.

Testing performance using crunner.py isn't really accurate so I used this line 
with a large, representative template (73K, 1600 lines, 5700 words, 20k tokens).

spitfire-trunk-speedy> time scripts/spitfire-compile -O3 -X 
no-use-dependency-analysis test.spt test.spt test.spt test.spt test.spt 
test.spt test.spt test.spt test.spt test.spt
WARNING: unable to import psyco

real    0m5.426s
user 0m5.270s
sys  0m0.143s

Original comment by ms...@gmail.com on 26 May 2011 at 4:40