[reportlab-users] Reportlab performance
Henning von Bargen
H.vonBargen at t-p.com
Wed May 12 09:55:32 EDT 2010
Leszek Syroka wrote:
> Right now our main concern is performance of 'platypus'. Creating a
> document, similar to attached one, but containing 1032 pages, about
> 1 200 000 characters and no images takes about 12 minutes.
> Is it a normal time of creating such document?
12 minutes seems slow indeed. I would expect 1 or 2 minutes.
Are you sure that this is caused by ReportLab?
Could as well be a slow SQL query or whatever...
> Moreover I found out that to insert the table of contents document
> is created in three iterations. First time to create a document with
> blank table of contents, second one to put there and adjust
> dynamically created one and third time to fit the table of contents
> containing more than one page.
> Is it possible to make this operation only once?
...
Yes, it should be possible to just do that in one or at most 2 passes.
The idea is that you tell ReportLab in advance that you expect
the TOC needs N pages (you can compute that in your special case,
since you need one TOC row per article).
You could perhaps use insert a custom flowable after the TOC
that splits until page N is reached.
HTH
Henning
More information about the reportlab-users
mailing list