Thursday, April 19
Hey Hey!
I went ahead and implemented a first pass of the performance enhancing technique I spoke about earlier. The template parser still handles data tags purely using lookup tables - this is not the full smart-parser version - so it requires some extra setup effort that may be wasted in the end.
The first cut of it was somewhat disappointing - 10%, maybe 15% faster. I decided to experiment further to see if I could do better than that. The first version was creating custom objects with formatting codes and dropping them into the lookup table; I decided to try just using raw tuples (a Python built-in structure, essentially a fixed list).
That did the job: Gains jumped to over 40%. Object creation seems to be about as expensive as a function call, so I was eating up most of my potential improvement right there.
I'll bash on it for a couple of days, then put the new engine into this Sunday's update.
Comments are disabled.
Post is locked.
I went ahead and implemented a first pass of the performance enhancing technique I spoke about earlier. The template parser still handles data tags purely using lookup tables - this is not the full smart-parser version - so it requires some extra setup effort that may be wasted in the end.
The first cut of it was somewhat disappointing - 10%, maybe 15% faster. I decided to experiment further to see if I could do better than that. The first version was creating custom objects with formatting codes and dropping them into the lookup table; I decided to try just using raw tuples (a Python built-in structure, essentially a fixed list).
That did the job: Gains jumped to over 40%. Object creation seems to be about as expensive as a function call, so I was eating up most of my potential improvement right there.
I'll bash on it for a couple of days, then put the new engine into this Sunday's update.
Posted by: Pixy Misa at
11:22 PM
| Comments (2)
| Add Comment
| Trackbacks (Suck)
Post contains 164 words, total size 1 kb.
46kb generated in CPU 0.0223, elapsed 0.1192 seconds.
56 queries taking 0.1092 seconds, 359 records returned.
Powered by Minx 1.1.6c-pink.
56 queries taking 0.1092 seconds, 359 records returned.
Powered by Minx 1.1.6c-pink.









