unbuffered vs. buffered terminal output
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
Pawel Jackowski wrote:
following trivial observation i made (several runs)[...] Has anybody similar statistics?
Just another trivial observation, that in dosish os displaying is even more expensive.
hm, not in a windows shell; it depends on the font you use! Hans
following trivial observation i made (several runs)[...] Has anybody similar statistics?
Just another trivial observation, that in dosish os displaying is even more expensive.
hm, not in a windows shell; it depends on the font you use!
well, yes, it depends on the font, but even for the simplest raster font the windowish terminal (cmd, not custom shell I use) still seems to be slower. but ok, i thought it is obvious, if not, further tests are to be done. -- Pawe/l Jackowski P.Jackowski@gust.org.pl
On 2005-12-21 21:16:32 +0100, Hartmut Henkel wrote:
So at least here pdfetex spends lots of time just for unbuffered talk to the terminal. And it's faster with a smaller window.
If you want speed, use \batchmode.
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().
Using buffered terminal output would IMHO seriously change the appearance of TeX, so no. Best Martin -- http://www.tm.oneiros.de
Hartmut Henkel wrote:
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?
it is a known fact that the speed depends on the kind of terminal; when one has a console that uses outline fonts or is graphical in nature (e.g. on the mac) the penalty can be huge; try batchmode -) on my machine (windows xp) the size of the windows does not matter that much (i use 5000 line scrollbacks) maybe this 'locale' thing is interfering as well? are chars written one by one or by line? maybe there is some intermediate way possible: - normal messages -> buffered - immediate/write16 -> flush pending messages and write unbuffered (btw, in your case, i'd try to optimize the terminal fonts; did you compare pdfetex with e.g. compiling pdftex?) Hans
On 2005-12-22 10:39:06 +0100, Hans Hagen wrote:
are chars written one by one or by line? maybe there is some intermediate way possible:
- normal messages -> buffered - immediate/write16 -> flush pending messages and write unbuffered
And what about [1][2]? I want to see the time between [ and 1 and ] :-) Best Martin -- http://www.tm.oneiros.de
"Martin" == Martin Schröder
writes:
On 2005-12-22 10:39:06 +0100, Hans Hagen wrote:
are chars written one by one or by line? maybe there is some intermediate way possible:
- normal messages -> buffered - immediate/write16 -> flush pending messages and write unbuffered
And what about [1][2]? I want to see the time between [ and 1 and ] :-)
Yes, it is annoying if you see nothing for a long time and then a complete line appears. But do not expect to see anything at all when you buy a new computer today. On my new machine (AMD64, 2.2 GHz) texbook.tex compiles within 0.665 seconds. That's about 1.5 ms per page! What do you expect to see? It seems to be reasonable to give up the feature you asked for and try to get a result as fast as possible. There is one big problem though: What happens when TeX runs into an endless loop? You don't see where it happens if only complete lines are issued. Regards, Reinhard -- ---------------------------------------------------------------------------- Reinhard Kotucha Phone: +49-511-4592165 Marschnerstr. 25 D-30167 Hannover mailto:reinhard.kotucha@web.de ---------------------------------------------------------------------------- Microsoft isn't the answer. Microsoft is the question, and the answer is NO. ----------------------------------------------------------------------------
"Hartmut" == Hartmut Henkel
writes:
On Fri, 23 Dec 2005, Reinhard Kotucha wrote:
There is one big problem though: What happens when TeX runs into an endless loop? You don't see where it happens if only complete lines are issued.
this can be handled by a reasonable timeout, using function select().
A timeout is not a solution. TeX simply doesn't know what I want. Reinhard -- ---------------------------------------------------------------------------- Reinhard Kotucha Phone: +49-511-4592165 Marschnerstr. 25 D-30167 Hannover mailto:reinhard.kotucha@web.de ---------------------------------------------------------------------------- Microsoft isn't the answer. Microsoft is the question, and the answer is NO. ----------------------------------------------------------------------------
On 2005-12-23 00:21:10 +0100, Hartmut Henkel wrote:
this can be handled by a reasonable timeout, using function select().
If it ain't broken, don't fix it. Keep it simple, stupid. :-) Both apply here -- if you need speed, use \batchmode. Best Martin -- http://www.tm.oneiros.de
participants (5)
-
Hans Hagen
-
Hartmut Henkel
-
Martin Schröder
-
Pawel Jackowski
-
Reinhard Kotucha