gofpdf icon indicating copy to clipboard operation
gofpdf copied to clipboard

Consider concurrent page generation

Open ajstarks opened this issue 3 years ago • 2 comments

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

ajstarks avatar Jun 14 '21 13:06 ajstarks

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

sbinet avatar Jun 15 '21 07:06 sbinet

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

ajstarks avatar Jun 16 '21 21:06 ajstarks