Re: Clarification of 2 Trivial Issues?

Frank Heckenbach <[email protected]> Mon, 21 Feb 2022 01:54:40 +0100
Newsgroups gmane.comp.gnu.make.devel
Message-ID <E1nLwyO-00CeMa-0j@mars>
Paul Smith wrote:

> On Wed, 2022-02-16 at 20:35 -0800, Jon Forrest wrote:
> > 1) In "filedef.h I see the composition of the "file" struct, with the
> > comment
> > 
> > /* Structure that represents the info on one file
> >     that the makefile says how to make.
> >     All of these are chained together through 'next'.  */
> > 
> > But there is no field named "next" in a "file" struct.
> > Instead, there's a field named "deps", which is a pointer to the
> > "dep" structure. The "dep" structure does contain a "next" field.
> 
> I think the "next" field got renamed to "prev" and the comment was not
> updated.

Just an outsider thought:

We sometimes hear about performance issues with large and complex
makefiles. (I don't have them myself; apparently my makefiles are
small and simple enough. :)

Linked lists are known for generally worse performance than
contiguous data structures due to cache misses. So might it be worth
to change the data structure to e.g. dynamic, exponentially growing
(for amortized constant complexity) arrays, similar to std::vector
in C++? (I know, in C that's more involved than changing std::list
to std::vector, but if performance problems are serious for some
users, it might be worth it.)