From: David Laight <David.Laight@ACULAB.COM>
To: 'Linus Torvalds' <torvalds@linux-foundation.org>
Cc: Tom Tromey <tom@tromey.com>,
Alexey Dobriyan <adobriyan@gmail.com>,
"Luc Van Oostenryck" <luc.vanoostenryck@gmail.com>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
Sparse Mailing-list <linux-sparse@vger.kernel.org>
Subject: RE: [PATCH 00/11] pragma once: treewide conversion
Date: Fri, 5 Mar 2021 09:19:42 +0000 [thread overview]
Message-ID: <44a0cc9cb5344add8ee4d91bffbf958f@AcuMS.aculab.com> (raw)
In-Reply-To: <CAHk-=wh8PptzH-=ak1D7C5Zp6EJ8eurYqVqGdQauupAFaNuG4g@mail.gmail.com>
From: Linus Torvalds
> Sent: 04 March 2021 20:16
>
> On Thu, Mar 4, 2021 at 5:55 AM David Laight <David.Laight@aculab.com> wrote:
> >
> > > (a) the traditional include guard optimization HAS NO HIDDEN SEMANTIC
> > > MEANING. It's a pure optimization that doesn't actually change
> > > anything else. If you don't do the optimization, absolutely nothing
> > > changes.
> >
> > And if the parser is well written the optimisation is probably
> > irrelevant compared to the compile time.
>
> That's actually surprisingly not even remotely true.
The point is that you can skip the unwanted parts of
#if without having to parse the file at all.
You just need to detect the line breaks.
So yes, you need to read the file and look at every byte.
But you don't need to even start tokenising it.
David
-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
next prev parent reply other threads:[~2021-03-05 9:20 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <YDvLYzsGu+l1pQ2y@localhost.localdomain>
2021-02-28 17:46 ` [PATCH 00/11] pragma once: treewide conversion Linus Torvalds
2021-02-28 19:34 ` Alexey Dobriyan
2021-02-28 20:00 ` Linus Torvalds
[not found] ` <877dmo10m3.fsf@tromey.com>
2021-03-03 20:17 ` Linus Torvalds
2021-03-04 13:55 ` David Laight
2021-03-04 20:16 ` Linus Torvalds
2021-03-05 9:19 ` David Laight [this message]
2021-03-05 21:23 ` Linus Torvalds
2021-03-06 13:07 ` Miguel Ojeda
2021-03-06 21:33 ` Linus Torvalds
2021-03-23 10:03 ` Pavel Machek
2021-03-01 0:29 ` Luc Van Oostenryck
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=44a0cc9cb5344add8ee4d91bffbf958f@AcuMS.aculab.com \
--to=david.laight@aculab.com \
--cc=adobriyan@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sparse@vger.kernel.org \
--cc=luc.vanoostenryck@gmail.com \
--cc=tom@tromey.com \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).