|
From: Jaroslav G. <j_g...@ya...> - 2001-02-12 10:24:40
|
--- Finn Bock <bc...@wo...> wrote:
> I would use something like this:
...
> public void setTemplate(String tmpl) {
> template = tmpl;
> templateCode = __builtin__.compile(template, "<template>",
> "exec");
Thank you, that's exactly what I was looking for!
I saw something similar when I was browsing
PythonInterpreter source code, but I was not sure
if this can be used completely out of context
and without care about interpreter state.
I changed my source according to your suggestion
and the time needed to execute my benchmark 1000-times
decreased from nearly 17 sec to 720 milliseconds.
Thanks.
Jarda Gergic
=====
Jaroslav Gergic (Gergi)
mailto:j_g...@ya...
http://nenya.ms.mff.cuni.cz/~gergic/
__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35
a year! http://personal.mail.yahoo.com/
|