[pdftex] TeX as a composition server?

John Dey jsdey at optonline.net
Mon Oct 25 23:17:16 CEST 2010

Just for fun I ran a very similar test in latex with four paragraphs generated by lorem-ipsum-generator on my laptop (lenovo t60p) running ubuntu 10.10 with the command "time pdflatex test.tex".  9999 pages were created in 22.5 seconds.

My file:



Mus sapien torquent, suspendisse inceptos nibh sociis praesent urna
accumsan ornare, metus venenatis. Quis. Morbi adipiscing amet class
eni orci sollicitudin id viverra cras eu. Vehicula auctor. Id,
curabitur a, purus ad sollicitudin nostra, mi, aliquam nibh
torquent. Semper netus nam eget purus blandit vulputate, facilisi
netus ut imperdiet purus. Ad hendrerit massa dictum pellentesque
conubia eros arcu nascetur senectus congue tellus arcu. Odio felis
dapibus. Nibh proin iaculis litora in aenean gravida. Aliquet tortor
ante phasellus ridiculus vestibulum mus vestibulum vestibulum
eu. Dictum potenti, euismod cras mi diam vehicula non,
blandit. Pharetra est, fusce arcu habitant ligula.

Posuere posuere phasellus ac penatibus a. Eget ut purus
fermentum. Nibh proin aliquam. Scelerisque. Massa est. Ante. Massa
ac. Dictum a, senectus. Ve libero pretium ve. Nostra at, torquent ante
quisque ligula, orci. Tincidunt nulla, id donec proin. Turpis rutrum
pharetra lacus taciti, dignissim. Facilisis hac habitasse praesent,
lectus mauris cras leo nunc non.

Rutrum urna per netus amet a ante fusce. Curae dis vestibulum libero,
vel, ac metus ut taciti. At. Dictum potenti nunc
risus. Natoque. Netus. Orci arcu nam neque pretium libero enim.

Platea facilisis fermentum adipiscing duis tempus nec dis. In placerat
arcu elit. Elit eu felis nullam ante tempus id ante rutrum. Nisi
magnis, parturient consectetuer natoque, metus diam
imperdiet. Condimentum dui ve amet metus, iaculis nostra. Mauris
vestibulum. Blandit pede nisl lorem ut hymenaeos a,
tristique. Bibendum. Ullamcorper ac semper nec, nec. Sociosqu lorem,
sociosqu fermentum ve hymenaeos a morbi sodales diam. Nec, viverra,
nascetur lacus. Imperdiet neque, mauris vitae, in justo libero turpis
praesent hendrerit. Sociis. Diam velit vivamus morbi et accumsan purus
pede eget. A, praesent odio sit. Nonummy pede.
\ifnum\value{page}<10000 \repeat

On Oct 25, 2010, at 4:40 PM, Reinhard Kotucha wrote:

> On 25 October 2010 Peter Davis wrote:
>> On Mon, Oct 25, 2010 at 1:41 PM, Reinhard Kotucha
>> <reinhard.kotucha at web.de>wrote:
>>> On 25 October 2010 Peter Davis wrote:
>>>> Ok, now I have a few days to prove that some flavor of TeX is
>>>> equal to the task.  Specifically, I want to have TeX compose
>>>> and output tens of thousands of pages (or copies of the same
>>>> page).  I suppose the simplest thing would be some kind of
>>>> look that just composes the same page of text over and over
>>>> again, as many times as I want.
>>> Maybe I misunderstand, do you want to create documents where the
>>> content of all pages is exactly the same?
>> Basically, yes.  I just want to see how fast TeX can compose a few
>> tens of thousands of pages of text.  It could all be "Lorem ipsum
>> ..." or whatever.
> Ok, then I misunderstood you indeed.  If one really needs thousands of
> pages with the same content, one would certainly create only one page
> and set references to it in the PDF file.  This way I can generate
> 43,000 pages per second on my machine, regardless of the complexity of
> the page.  I had to redirect standard output to /dev/null, otherwise
> it's slower by the factor of two.
> For what you want to achieve I usually do the same as James proposed
> already.  However, you have to do the test in \batchmode, on my
> machine TeX needs 4 seconds to print the page numbers to screen (with
> James' example).
> I get some interesting results.  LaTeX needs 33 seconds while plain
> TeX needs only 23 seconds (both with pdftex).  Can anybody explain?
> The text doesn't contain any active characters or control sequences.
> I never expected such a big difference.
> When producing DVI, pdftex needs 11.5 seconds while Knuth's TeX needs
> only 10 seconds.
> pdflatex with font expansion and character protrusion takes a bit more
> than a minute, I can't test it right now with plain TeX.
> BTW, I would generate a file which can be \input by other files.  Then
> one can compare different formats.
> lorem.pl:
> -------------------------------------------------------
> #! /usr/bin/env perl
> $^W=1;
> my $n = 100000;
> my $lorem = <<'TXT';
> Lorem ipsum dolor sit amet, consectetur adipisicing elit,
> sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
> Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris
> nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor
> in reprehenderit in voluptate velit esse cillum dolore eu fugiat
> nulla pariatur. Excepteur sint occaecat cupidatat non proident,
> sunt in culpa qui officia deserunt mollit anim id est laborum.
> open TEXT,">","lorem.tex";
> for(1..$n) {
>   print TEXT $lorem;
> }
> close TEXT
> -------------------------------------------------------
> Then you can test it with different formats:
> lorem-latex.tex:
> -------------------------------------------------------
> \batchmode
> \documentclass{article}
> %\usepackage{microtype}
> \begin{document}
> \input{lorem}
> \end{document}
> -------------------------------------------------------
> lorem-plain.tex:
> -------------------------------------------------------
> \batchmode
> % Uncomment in order to create DVI:
> %\ifx\pdfoutput\undefined\else\pdfoutput=0 \fi
> \def\newpage{\par\vfill\eject} % allow \newpage in lorem.tex
> \input lorem.tex
> \bye
> -------------------------------------------------------
> Regards,
>  Reinhard
> -- 
> ----------------------------------------------------------------------------
> Reinhard Kotucha			              Phone: +49-511-3373112
> Marschnerstr. 25
> D-30167 Hannover	                      mailto:reinhard.kotucha at web.de
> ----------------------------------------------------------------------------
> Microsoft isn't the answer. Microsoft is the question, and the answer is NO.
> ----------------------------------------------------------------------------

More information about the pdftex mailing list