linux - Ghostscript Combine PDfs and Multithread/Core -
)
i know there couple of questions , threads out similar stuff none work me. i'm trying combine ~1000 pdf files in one. tried couple tools gs (ghostscript) proper compression. problem is multi threads not working/ i've got 24cores , use e.g. 8 task, top shows me uses still one. command:
gs -q -dnopause -dnoprompt -q -dbatch -dnumrenderingthreads=8 -dbandheight=100 -dbandbufferspace=500000000 -sbandliststorage=memory -dbufferspace=1000000000 -sdevice=pdfwrite -soutputfile=combined_gs.pdf sourcefiles/*.pdf
i have speed bit takes round 60 seconds , need on fly. suggestions?
the pdfwrite device doesn't use threading (it difficult so). clue in name 'numrenderingthreads', pdfwrite doesn't render.
since isn't rendering bandheight, bandbufferspace, bandliststorage , bufferspace have no effect. (you've specified -q twice)
please aware ghostscript , pdfwrite device not 'manipulate' pdf input, not combine, concatenate or similar. interpret input, creating set of graphic primitives, these primitives re-assembled brand new pdf output file. new output file has nothing in common of inputs, , our goal in visual appearance should same. while handle number of non-makring objects input these of secondary importance.
as obvious, more complex process treating contents of pdf file series of building blocks can rearranged, why slower. honest reading, interpreting, rewriting 1000 files in 1 minute seems pretty fast me.
Comments
Post a Comment