I've noticed that adding i18n to my app (i18n.run_template_filter=True)
is making page rendering slower. It even seems that rendering time
increases with the uptime of the TG application itself..
i.e. without i18n a typical page takes about 200-250ms to build (with
log_debug_info_filter.on = True) and with i18n it takes about 1.5s -
2s. (and up to 4s on my prod server on which the app is running since a
day now..)
I am using TG 0.9a8.
Is anyone else experiencing the same issue?
How do I go about debugging this, and finding out where TG is spending
most of its time?
Thanks,
Yannick
Yes, we are experiencing what looks like the same problem. No idea
where to start with that one... but what I know is: our client is
(rightfully) very unhappy, and TG is making us look bad... so, er.....
help, please?
PS: Our site is also on TG 0.9a8 and uses i18n, and even though it is
quite simple, it gets reeeeeeaaallllyyyyy slllllloooooowwwwwwww...
After a restart, the top page renders in 1.5s ~ 2s. It quickly climbs
up to 3s ~ 4s and keeps climbing. After less than a day, it's up to
10s... After a few days (right now) it's 22s...
--
Yves-Eric
Found a way to fix it:
in kid/__init__.py, line 182:
remove _filters = [transform_filter] from the class definition, and put
it inside the __init__ method, this is what is should look like:
-------------------------8<-------------------------------------
class BaseTemplate(object):
# the serializer to use when writing output
serializer = output_methods['xml']
def __init__(self, *args, **kw):
self.__dict__.update(kw)
self._layout_classes = []
self._filters = [transform_filter]
-------------------------8<-------------------------------------
I am sure this is not the right fix, but at least it now works for me!
:)
The problem was that the i18n filter was added to the _filters list
each time the page was called... So of course you ended up with a huge
list of filters by the time the page received some traffic.
Cheers,
Yannick
And this sounds like something that really ought to be fixed. So I
would hate to see your comments get lost in the shuffle.
--
Mark Ramm-Christensen
email: mark at compoundthinking dot com
blog: www.compoundthinking.com/blog
Thanks a lot Yannick!