The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
From: "G. Branden Robinson" <g.branden.robinson@gmail.com>
To: TUHS main list <tuhs@tuhs.org>
Subject: [TUHS] Re: On the uniqueness of DMR's C compiler
Date: Sat, 11 May 2024 08:42:21 -0500	[thread overview]
Message-ID: <20240511134221.w7v35qdey7z7j6wf@illithid> (raw)
In-Reply-To: <CABH=_VTCZz-N2rj6neWFfVb7=HKJ9tMJqNw6PcEv+2aJ_7a8iQ@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1139 bytes --]

At 2024-05-10T13:28:40-0400, Paul Winalski wrote:
> On Wed, May 8, 2024 at 2:29 PM Douglas McIlroy <
> douglas.mcilroy@dartmouth.edu> wrote:
> > Dennis was one-up on Digitek in having a self-maintaining compiler.
> > Thus, when he implemented an optimization, the source would grow,
> > but the compiler binary might even shrink thanks to
> > self-application.
> 
> Another somewhat non-intuitive aspect of optimizing compilers is that
> simply adding optimizations can cause an increase in compilation speed
> by reducing the amount of IL in the program being compiled.  Less IL
> due to optimization means less time spent in later phases of the
> compilation process.

This fact was rediscovered later when people found that some code
compiled with "-Os" (optimize for space) was faster than some code
optimized for speed ("-O1", "-O2", and so on).

The reason turned out to be that the reduced code size meant fewer cache
evictions, so you gained performance by skipping instances of
instruction fetches all the way from the slow main memory bus.

Think of all those poor unrolled loops...

Regards,
Branden

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  parent reply	other threads:[~2024-05-11 13:42 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-08 18:29 Douglas McIlroy
2024-05-10 17:28 ` Paul Winalski
2024-05-11  9:16   ` Ralph Corderoy
2024-05-11 13:42   ` G. Branden Robinson [this message]
     [not found] <171535904627.4052234.5321502833323676423@minnie.tuhs.org>
2024-05-10 18:55 ` Paul McJones
     [not found] <171519201646.4052234.694570138790187562@minnie.tuhs.org>
2024-05-09  3:39 ` Paul McJones
2024-05-09  3:46   ` Warner Losh
  -- strict thread matches above, loose matches on Subject: below --
2024-05-07 20:59 [TUHS] " Paul Ruizendaal
2024-05-07 22:07 ` [TUHS] " Rob Pike
2024-05-08  9:35   ` Paul Ruizendaal
2024-05-08 13:12     ` Rob Pike
2024-05-08 15:51     ` Clem Cole
2024-05-08 16:07       ` Jon Forrest
2024-05-08 17:49         ` Tom Perrine
2024-05-08 17:05       ` Adam Sampson
2024-05-08 17:45       ` Al Kossow
2024-05-08 18:12         ` Clem Cole
2024-05-08 18:12           ` Clem Cole
2024-05-09  1:27           ` Lawrence Stewart
2024-05-31 12:00       ` Paul Ruizendaal
2024-05-31 12:21         ` Peter Yardley
2024-05-08 11:09 ` Michael Kjörling
2024-05-09 20:40 ` Paul Ruizendaal via TUHS
2024-05-09 20:57   ` Al Kossow

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=20240511134221.w7v35qdey7z7j6wf@illithid \
    --to=g.branden.robinson@gmail.com \
    --cc=tuhs@tuhs.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).