gofpdf
gofpdf copied to clipboard
Consider concurrent page generation
For the generation of complex and many-paged documents, it may be useful to perform page generation concurrently. In the program pdfdeck, I use github.com/jung-kurt/gofpdf, which I believe could perform better using phpdave11/gofpdf using concurrent generation.
For example, rendering this deck: https://github.com/ajstarks/dubois-data-portraits/blob/master/baldwin/baldwin.dsh takes about 3.8 seconds on my X1 Carbon 5th Gen, under Linux and 3.5 seconds on a MacBook Pro, Late 2013 running Mac OS 11.4
Note that this deck is 45201976 bytes, 55 slides, with 87 unique images. (in my measurements, image rendering is among the most expensive).
hi @ajstarks
it sounds like a significant re-engineering :)
FYI, with these patches applied:
- https://github.com/phpdave11/gofpdf/pull/15
- https://github.com/phpdave11/gofpdf/pull/16 one can already get 30% improvements for shapes+colors formating.
as this repo seems unfortunately a bit dormant, I've started integrating these patches there:
- https://github.com/go-pdf/fpdf
I've installed github.com/go-pdf/fpdf, but sadly it slightly slower. Any plans to optimize image processing?