[reportlab-users] Re: Large tables - exponentially increasing run times

Henning von Bargen reportlab-users@reportlab.com
Mon, 17 May 2004 08:31:38 +0200


Craig,

it seems that you have the very special case with your table
that you know row heights and column widths in advance
- in effect meaning all your cell data is very short and you
don't need line wrapping.

Of course it is possible to write a faster implementation
for this special case (since there's no height/width calculation at all
and you don't have to format any Paragraphs or plain strings).

I encourage you to use your implementation for your specific problem.

However, as soon as you're going to use more dynamic data
(with variable length, say, from a database)
and you want Platypus to calculate row heights itself,
you will have to format Paragraphs/strings at least one time.
The LongTable solution does it at most 2 times for each
cell (0x/1x height calculation, 1x actually drawing).
Thus it is still not optimal (from a theoretical point of view),
but it would require a lot of tweaking to further tune it,
making it hard to read and hard to maintain.

Henning