[reportlab-users] Tons of table questions

Robin Becker robin at reportlab.com
Thu Feb 26 06:29:29 EST 2009


Dinu Gherman wrote:

> Hi,

>

> I guess this is the main (FAQ one) to start with... How can I make

> tables render more quickly?

>

> From my experiments it seems that tables are rendered roughly in

> O(n^2) with n being the number of rows (in my current example 1000

> rows take a minute, but 10 x 100 take 6 seconds).

>

> Does it have to be like that? What can be done against it? Do plain

> strings instead of Paragraphs help? Does it help to preset all col-

> umn widths with fixed values? Is the LongTable class the solution?

>

> Also, is there any useful sample code / test / documentation for

> the splitlast/splitfirst features in tables that one can understand

> without digging into mail archives, only to find that it likely

> is not working as it should?

>

> And finally, is there a workaround to speedup table rendering by

> splitting it into little chunks and concatenating them? In order

> for that to work one would need a table header that is shown only

> at the beginning of a new frame. Is that realistic?

>

> Regards,

>

> Dinu


Dinu there was a long discussion about table times a few years ago. In
particular there was a longTable speedup proposed and contributed by Henning von
Bargen. That was about 5 years ago. In rl_config.py there's a variable to turn
this optimisation on and off for the default Table class. If you set it to one
in your local_rl_config then you should get rid of the n**2 behaviour.
--
Robin Becker


More information about the reportlab-users mailing list