Discussion:
New releases
Malthe Borch
2008-11-29 09:47:27 UTC
Permalink
The compilation strategy has been changed in the most recent Chameleon
release (1.0b11).

Instead of using Python's built-in ``pycodegen`` module to generate
byte-code from the AST, we're now using a new invention of mine,
``sourcecodegen``, to actually create Python source-code from the AST
in order to use the built-in source-code compiler. This may seem
backwards, but it has several advantages:

1) Debugging is easier, because what you see is what you get.
2) No magic insertion of globals; the source-code is by necessity self-contained
3) There's no longer an artificial template size limit (as previously
imposed due to stack size reasons)

I've issued new releases of all involved packages.

I've also corrected a benchmark comparing performance between
preparing Chameleon and ZPT for rendering (e.g. parsing/compilation
steps). Chameleon is still quite slow on a cold boot (30 times
slower), but when the cache is used (e.g. "warm boot"), there's only a
factor of 1.25 to differ.

Malthe

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "z3c.pt" group.
To post to this group, send email to ***@googlegroups.com
To unsubscribe from this group, send email to z3c_pt+***@googlegroups.com
For more options, visit this group at http://groups.google.com/group/z3c_pt?hl=en
-~----------~----~----~----~------~----~------~--~---
Wichert Akkerman
2008-11-30 23:20:05 UTC
Permalink
Post by Malthe Borch
I've also corrected a benchmark comparing performance between
preparing Chameleon and ZPT for rendering (e.g. parsing/compilation
steps). Chameleon is still quite slow on a cold boot (30 times
slower), but when the cache is used (e.g. "warm boot"), there's only a
factor of 1.25 to differ.
How do I interpret that? Is chameleon only 1.25 faster than zpt when
rendering, or is there a compile penalty at every render?

Wichert.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "z3c.pt" group.
To post to this group, send email to ***@googlegroups.com
To unsubscribe from this group, send email to z3c_pt+***@googlegroups.com
For more options, visit this group at http://groups.google.com/group/z3c_pt?hl=en
-~----------~----~----~----~------~----~------~--~---
Hanno Schlichting
2008-11-30 23:39:26 UTC
Permalink
Post by Wichert Akkerman
Post by Malthe Borch
I've also corrected a benchmark comparing performance between
preparing Chameleon and ZPT for rendering (e.g. parsing/compilation
steps). Chameleon is still quite slow on a cold boot (30 times
slower), but when the cache is used (e.g. "warm boot"), there's only a
factor of 1.25 to differ.
How do I interpret that? Is chameleon only 1.25 faster than zpt when
rendering, or is there a compile penalty at every render?
No. This test only compares compilation and has nothing to do with
rendering speed. Since we have class level caches in place, the
compilation is only ever done once, no matter if you use persistent
cache files or not.

Rendering speed is still anywhere between 2x to 20x faster depending on
the actual template.

The 1.25x factor means: If you use a persistent filesystem cache which
stores the compiled templates as pickles, the time it takes to load
those pickles and execute them is 1.25 times slower in chameleon, than
it takes ZPT to parse a template and generate the program code for it.

The 30x slower factor included the time it takes chameleon to load the
template, parse it via lxml, create an AST and turn it into byte-code,
eventually pickling it to the file system for caching purposes.

The persistent cache is there to cut down startup time for new
processes, which is quite useful in development.

Hanno


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "z3c.pt" group.
To post to this group, send email to ***@googlegroups.com
To unsubscribe from this group, send email to z3c_pt+***@googlegroups.com
For more options, visit this group at http://groups.google.com/group/z3c_pt?hl=en
-~----------~----~----~----~------~----~------~--~---

Loading...