Le 29/06/2011 06:48, Michael Pedersen a écrit :
As I read this, I find myself wondering what you're actually testing. The reason I ask is because you're discussing the rendering speed without telling us how you're measuring it.

You could be measuring how long it takes for the HTML to be sent to the browser, *or* how long it takes before the page is viewable by the user. If you're measuring the latter, then I have to point out that the last time I tried to render a table with over a thousand rows, it pretty much choked the browsers entirely. Pagination was required.
You're right, as I started by testing the whole system (database access + server + rendering in the browser). Actually, I added some time logging for the database part, I make queries using wget, and I also added some time logging at the beginning/end of my controller function.

The huge part of time used when processing a query is "out of my python code", meaning it's in the framework or in my template code (and I know it's in my templates;) I tried removing some parts of my templates and it fixes the performance issue (but this is only test as I need what I developped).
If you're measuring how long it takes for the page to be received (for instance, via wget), then yes, there's a whole different question.
That's it.
For that, double check how your templates are being @expose'd. Make sure that it looks like this:

@expose('chameleon_genshi:dotted.template.name')

and not this:

@expose('genshi:dotted.template.name')

Actually, I believe we missunderstood.
* I'm currently using Genshi. I face performance issues explained in my first message. => any help welcome.
* Then, I tried to use Chameleon.genshi in order to see if there are performance increase. => I failed using it. => any help welcome.

For the Genshi part, I use a lot of <py:def function="myFunctionWithParameters(bla,bla2,bla3...)"></py:def> which are called in loops of loops (that's why, I believe, it's not efficient).

I'm thinking about migrating to Mako if :
* I can't improve genshi performance
* I can't succeed in setting up chameleon.genshi

(I'd like not to migrate to mako as I like the way genshi guarantee the XML strucutre)

Damien

That's all I've got right now, anyway.

On Tue, Jun 28, 2011 at 6:51 PM, Damien Accorsi <[email protected]> wrote:
Hello all,

I face dramatic performance issue with a page rendering a table with around 1000 lines and around 10 columns, certainly because of the content of the cells which is made of forms, images, etc. I'm using genshi. If I remove the genshi.XML() call (which I believe makes the XML validation), then the rendering duration becomes user-friendly.

For that reason, I'd like to try the chameleon genshi template engine which is base on a C library for the XML stuff. I didn't find documentation (there is a page on the TG2.1 online doc, unfortunately it's "empty").

The first step I did was to install chameleon.core 1.0.3 (the last release seems to be broken ?!), and to configure the app_cfg.py with the following lines:

base_config.renderers.append('genshi')
base_config.renderers.append('chameleon_genshi')
base_config.default_renderer = 'chameleon_genshi'

but it seems to work the same way (I mean... really slowly, while the chameleon.genshi doc says it should be around as fast as mako template engine).

Any idea, link? Any information so that I can add some stuff to the official documentation?

Damien




--
You received this message because you are subscribed to the Google Groups "TurboGears" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to [email protected].
For more options, visit this group at http://groups.google.com/group/turbogears?hl=en.



--
Michael J. Pedersen
My IM IDs: Jabber/[email protected], AIM/pedermj022171
          Yahoo/pedermj2002, MSN/[email protected]
My LinkedIn Profile: http://www.linkedin.com/in/michaeljpedersen
Twitter: pedersentg

--
You received this message because you are subscribed to the Google Groups "TurboGears" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to [email protected].
For more options, visit this group at http://groups.google.com/group/turbogears?hl=en.

--
You received this message because you are subscribed to the Google Groups "TurboGears" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to [email protected].
For more options, visit this group at http://groups.google.com/group/turbogears?hl=en.

Reply via email to