phpdave11 / gofpdf

A PDF document generator with high level support for text, drawing and images
http://godoc.org/github.com/phpdave11/gofpdf
MIT License
214 stars 42 forks source link

Consider concurrent page generation #17

Open ajstarks opened 3 years ago

ajstarks commented 3 years ago

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).

sbinet commented 3 years ago

hi @ajstarks

it sounds like a significant re-engineering :)

FYI, with these patches applied:

as this repo seems unfortunately a bit dormant, I've started integrating these patches there:

ajstarks commented 3 years ago

I've installed github.com/go-pdf/fpdf, but sadly it slightly slower. Any plans to optimize image processing?