[NTG-pdftex] unbuffered vs. buffered terminal output

Hartmut Henkel hartmut_henkel at gmx.de
Wed Dec 21 21:16:32 CET 2005

following trivial observation i made (several runs):

$ time pdfetex samplepdf

real    0m2.536s
real    0m2.605s
real    0m2.737s
real    0m2.654s

$ time pdfetex samplepdf | buffer

real    0m0.900s
real    0m1.035s
real    0m0.900s
real    0m0.913s

the speed gain is impressive here, also with other files from daily
business and for longer runs. Same if i write

$ pdfetex samplepdf > xxx

So at least here pdfetex spends lots of time just for unbuffered talk to
the terminal. And it's faster with a smaller window.

Maybe we should think of implementing buffered writing? See e. g. man 3
setbuf. The problem is that it should fflush() in case of errors and
switch to unbuffered. And maybe it should fflush() also after a certain
time of say 0.5 s, which would require select().

Has anybody similar statistics?

Regards, Hartmut

More information about the ntg-pdftex mailing list