One of the most problematic parts of Genshi performance wise is match
tags, since they are each compared to every tag in the stream as they
go by, so you may be able to get some good performance improvements by
using py:def template functions rather than match tags in various
places.

And you may gain some huge performance increases on large pages by
using Mako or Jinja instead of genshi.   I'd try it with one page to
see how it changed things.

SQLAlchemy query performance is harder to provide optimization
suggestions for, but I'm sure that we'll be willing to help out on the
list if you distill some data for us. You might be able to make fewer
queries by turning on eager loading of some data, and you might be
able to add some indexes to speed up slow performing queries.

If you have big query result sets that can be cached, you can use
Beaker's cache system even with tg 1.x, and caching may help you a
lot.

--Mark Ramm

On Fri, May 29, 2009 at 10:03 PM, Uwe C. Schroeder <[email protected]> wrote:
>
> On Friday 29 May 2009, Mark Ramm wrote:
>> Yea, we should have been clearer TG 2.0 is not backwards compatable
>> with 1.0, and it requires some siginficant work to port applications.
>>  Sounds like your app is very large, and would take a long time to
>> migrated.
>
> it is - some 30k+ lines of controller code alone.
> I guess I'm the only one running a social networking app on TG1 :-) The
> downside of social networking is that every page is fully dynamic and has to
> change for every user according to their status/settings etc.
> (if you want to look at it: http://www.bunspace.com/ - ok, I'm officially a
> rabbit weirdo)
>
>> And I agree that we need better docs, but we've just not have enough
>> help to move everything forward on every front that we should have,
>> and the TG2 docs will continue to get better as people help us ;)
>
> I will eventually move the app over to TG2, mainly because I like the
> deployment options better and cherrypy 2 is just really slow compared to
> newer things. I'd be happy to write up some docs as I go along. I know how it
> goes with docs. My main occupation is - who guessed - programming
> applications. The largest I ever wrote (1M+ lines of code) doesn't have a
> single line of documentation other than comments in the code. There's just
> never time to document and when you're writing it, it's all so clear to you
> but someone else will struggle.
>
>> As for speed, I've definitely gotten better performance out of TG 1.x
>> than 2 requests per second, so I'm guessing that some of the
>> performance enhancemnents you need are not in the framework, but in
>> application code.
>
> I just ran a couple of tests and it looks to me that Genshi is the main issue
> (in TG1 as well as TG2). My main page template takes about 2 seconds to
> render. SA/database queries take another 1 to 2 seconds, so I never make it
> out under 4 seconds - not counting the cherrypy overhead in TG1
> My templates are a bit complicated and I guess I can improve on them. I'll
> spend some time fiddling with the main template to see whether I can't
> improve the rendering time by simplifying things.
>
> Uwe
>



-- 
Mark Ramm-Christensen
email: mark at compoundthinking dot com
blog: www.compoundthinking.com/blog

--~--~---------~--~----~------------~-------~--~----~
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