Re: stabs vs. dwarf-2 for C programs

DJ Delorie
2001-04-13T22:37:00Z

> > I'm pretty sure this alone will cut linking time by a large factor,
> > based on the number of seeks and the amount of time they are taking,
> > in a few tests i just did.
>
> It's possible. Around 1997 or so I tried using mmap as you suggest.
> It actually made the linker slower on the systems I tested it on,
> including Solaris and on the Linux kernel, so I dropped the effort.
> But, as you say, times change, and maybe now it would indeed be
> faster. It's an easy optimization in BFD; why don't you try it?

One of the optimizations in DJGPP's runtime library is specifically
because the linker does a lot of seeks (other programs, like gcc, tend
to stream data instead). We changed the buffer size dynamically to
adapt to random vs linear accesses. Of course, this assumes your
default buffer size is bigger than a sector anyway. Linux seems to
have a 4k buffer; try setting the buffer size to 512 for all bfds in
the linker and see if it improves performance.