www.delorie.com/djgpp/v2faq/faq049.html | search |
A few users have reported that they got much faster linking after they've stub-edited ld.exe to decrease the transfer buffer size to 4KB or even 2KB. This speedup effect is usually seen
when DJGPP is installed on a networked drive or on a compressed disk, and sometimes when you run DJGPP from a DOS emulator (such as OS/2 DOS box); when DJGPP is installed on a local disk drive on
plain DOS or Windows, linking speed is not affected by the size of transfer buffer. The reason for this seems to be the large number of calls to fseek
function issued by the linker,
which defeats the benefits of aggressive buffering imposed by the default 16KB size of the transfer buffer. (DJGPP v2.02 will introduce a heuristic into the buffering of stdio
functions, whereby the size of the buffer for each FILE *
stream adapts itself to the behavior of that stream--grows when the stream is read sequentially, and shrinks when it is seeked.
This should eliminate the need for stubediting ld.exe and other similar programs.)
If you use a disk cache, make sure you enable its write-back (a.k.a. delayed-write) operation. Some people disable the delayed-write feature for safety reasons, to avoid losing files due to system crashes. If you are worried about this, you can usually gain performance without sacrificing safety by enabling delayed-write together with an option that causes the cache to flush the write-behind data before the system returns to the DOS prompt. For SmartDrv disk cache, this is achieved by specifying /N/F switches instead of /X.
For very large (several MBytes) executables which are built from a large number of small source files, the link (as opposed to the compilation) stage might be the one which needs more RAM than you have free, and thus be the bottleneck of the time it takes to build your program. Check that the size of the executable isn't larger than the amount of your free RAM. If it is, then it might make sense to use a smaller (or even no) disk cache, and allow the linker as much physical RAM as it needs. Make sure that the linker wasn't stub-edited to make its transfer buffer too small.
Another reason for slow linking might be that the DJGPP.ENV file by default sets TMPDIR
to a tmp/ subdirectory of the main DJGPP installation directory; if
DJGPP is installed on a networked drive, this means all your temporary files go back and forth through the network (and networked disks are usually not cached on your PC). In such cases, setting
TMPDIR
to a directory on your local drive, or to a RAM disk, would probably make linking faster.
Generally, it is not recommended to install DJGPP on a networked drive. If you have to, you should configure your network interface for best performance. Consult your network administrator.
webmaster donations bookstore | delorie software privacy |
Copyright ⌐ 1998 by Eli Zaretskii | Updated Sep 1998 |
You can help support this site by visiting the advertisers that sponsor it! (only once each, though)