turn off lazyIO on disk files

Wolfgang Helbig helbig at lehre.ba-stuttgart.de
Fri Jul 4 20:44:21 CEST 2008


Frank Heckenbach wrote:
>> On writing, GPC doesn't buffer yet at all; it's not implemented yet.
>> It's not that it couldn't be done, but it's more tricky, because GPC
>> supports various ways of seeking, pre-reading, getting the file
>> position etc., which all would have to take account of the buffers.
>> If it's a serious problem you could kludge it by installing a
>> user-defined file write routine which can do the buffering. If you
>> know that your application only does sequential writes, this would
>> work. I've done this once (see RewriteBuffer in cgi.pas in
>> http://fjf.gnu.de/misc/cgiprogs.tar.bz2). Let me know if you need
>> more details.
>> Frank
Thanks for the enlightement about buffering in GPC.

And Emil Jerabek wrote:
>The bottleneck in TeX's I/O is the output to the dvi file, which is
>done byte by byte (there's no other choice in standard Pascal). Knuth
>himself notes that this is inefficient, the porter is expected to
>optimize it:

>In the case of GPC, it is trivial to replace the write_dvi procedure
>with a single call to BlockWrite. This makes a huge difference in the
>running time.

Did that. And the time command shows the difference:
       64.45 real        15.16 user        48.45 sys
       11.40 real        10.55 user         0.57 sys
Compares pretty good to a web2c based distribution of TeX, in this case 
        7.54 real         7.01 user         0.17 sys
Thanks to both of you,
Wolfgang Helbig
"Dijkstra is right, but you don't say such things!"
(A less courageous programmer)

More information about the Gpc mailing list