On Wed, 23 Mar 2016 23:21:37 -0400 Steve Izma <[email protected]> wrote:
> I'm wondering if anyone can tell me if groff benefits from running on > multiple CPU cores and multiple CPUs. Looking at spawn-pipe.c, the only parallelization you get in groff is the pipeline of preprocessing, formatting, and rendering. ISTM that's all you *can* get because the formatting process -- determining which words go on each line -- is necessarily sequential. The whole-paragraph formatting algorithm Doug McIllroy proposed some time back worked in parallel, but each paragraph would still be rendered serially. As others noted, rendering is expensive, and I bet as a practical matter that's also sequential because the device holds so much state. Maybe in theory it's be possible to denote, say, paragraphs in the ditroff output, render each one independently as Postscript, and knit them all together in the output. But the driver holds "current" information about e.g. the font, pen, and position, at least some of which I would think affects the rendering logic. If it could be done in parallel, it would surely be more complex, and it's not obvious it would be much faster. --jkl
