improve speed of TicketQuery for format=table
|Reported by:||Christian Boos||Owned by:|
format=table was added in 0.11 merely as a proof-of-concept to see how Genshi templates could be reused in different contexts, in this case within a WikiMacro.
That proved to work well, except for the performance side of things (see e.g. #10879).
A query like
[[TicketQuery(status=closed,format=list)]] on this site (corresponding to 11043 tickets) would take several seconds to complete successfully, while
[[TicketQuery(status=closed,format=table)]] fails after several (more) seconds with:
Error: Macro TicketQuery(status=closed,format=table) failed
and in the log we see:
[pid 9964 139956728231680] 2013-05-13 18:46:25,397 Trac[formatter] ERROR: Macro TicketQuery(status=closed,format=table) failed: Traceback (most recent call last): File "/usr/local/virtualenv/1.1dev/lib/python2.6/site-packages/Trac-1.1.2dev_r11794-py2.6.egg/trac/wiki/formatter.py", line 765, in _macro_formatter return macro.ensure_inline(macro.process(args)) File "/usr/local/virtualenv/1.1dev/lib/python2.6/site-packages/Trac-1.1.2dev_r11794-py2.6.egg/trac/wiki/formatter.py", line 380, in ensure_inline text = _markup_to_unicode(text) File "/usr/local/virtualenv/1.1dev/lib/python2.6/site-packages/Trac-1.1.2dev_r11794-py2.6.egg/trac/wiki/formatter.py", line 107, in _markup_to_unicode markup = stream.render('xhtml', encoding=None, strip_whitespace=False) File "/usr/local/virtualenv/1.1dev/lib/python2.6/site-packages/Genshi-0.7dev_r1134-py2.6.egg/genshi/core.py", line 183, in render return encode(generator, method=method, encoding=encoding, out=out) File "/usr/local/virtualenv/1.1dev/lib/python2.6/site-packages/Genshi-0.7dev_r1134-py2.6.egg/genshi/output.py", line 57, in encode return _encode(''.join(list(iterator))) MemoryError:
This presents a lot of implementation possibilities, but in a first step I believe simple jQuery based building should be good enough, there's probably no need of client-side templating or additional framework. I think that solving #10373 will also be a prerequisite.
Once it works for this use case, we could think about how to make the normal
/query pages benefit from the same performance boost (getting rid of the
Then, once we have a robust solution in place, gradually extend that to other "Genshi-intensive" places (diffs, source browser, timeline, etc.).
Change History (8)
follow-up: 3 comment:2 by , 5 years ago
|Milestone:||next-major-releases → 1.3.1|
|Status:||new → assigned|
comment:7 by , 3 years ago
|Milestone:||next-dev-1.3.x → next-major-releases|