[reportlab-users] Large tables are very slow to produce

Andy Robinson andy at reportlab.com
Thu Nov 8 20:27:10 EST 2007


On 09/11/2007, Mark Matthews <mem at object-craft.com.au> wrote:

> Hello,

>

> I have a requirement to produce very large tables (~5000 lines) and

> this is very slow. Has anyone any advice on how to improve performance?


Try making 5000 1-row tables and see how much faster it gets. That
will tell us if it's a problem with recursively sizing the whole
things, and under the hood it's just as good a solution.

Or, if your data breaks into more sensible sized bands with some kind
of group sub-totals, make each band a table of its own. If a table
usually fits on one page, you'll get good performance. This also
makes formatting easier too as you don't need to do clever
computations on which rows to apply different styles to.

The problem is that we may be trying to auto-size the whole thing
(longTable is supposed to fix this), or perhaps eating a lot of
memory. If you are explicitly setting the column widths yourself,
which makes for tidier documents and makes things faster anyway,
there's no reason to have one huge table.

Hope this helps,


--
Andy Robinson
CEO/Chief Architect
ReportLab Europe Ltd.
165 The Broadway, Wimbledon, London SW19 1NE, UK
Tel +44-20-8544-8049


More information about the reportlab-users mailing list