comp.lang.ada
 help / color / mirror / Atom feed
From: Emmanuel Briot <briot.emmanuel@gmail.com>
Subject: Re: Performance of records with variant parts
Date: Wed, 31 Mar 2021 23:45:26 -0700 (PDT)	[thread overview]
Message-ID: <dca8b80b-c9bf-4691-836f-976f608d5e33n@googlegroups.com> (raw)
In-Reply-To: <9233bc10-091c-46af-b613-504bcb5e1c82n@googlegroups.com>

> Studying the code, I realized that there was no reason that Intersections_Type had to keep a copy of thing(which); it could instead just remember which, and the caller could obtain thing(which) directly. 

Well done, seems like it wasn't so easy to find, even if the fix is simple in the end.
I think the -gnatD code you show is because GNAT is creating a temporary object then copying it in the output. So there's one extra copy. The like "A81b.think := things (which)" might be pretty costly too, depending on the size of thing.

  reply	other threads:[~2021-04-01  6:45 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-22 17:02 Performance of records with variant parts John Perry
2021-03-22 17:32 ` Jeffrey R. Carter
2021-03-22 17:49   ` John Perry
2021-03-22 17:54     ` John Perry
2021-03-22 19:31     ` Jeffrey R. Carter
2021-03-22 22:11       ` John Perry
2021-03-23  9:31         ` Jeffrey R. Carter
2021-03-23 14:27           ` Simon Wright
2021-03-23 23:00           ` John Perry
2021-03-23 23:27             ` Jeffrey R. Carter
2021-03-26 15:38               ` Stephen Leake
2021-03-26 15:44                 ` John Perry
2021-03-30  7:12                   ` Emmanuel Briot
2021-04-01  0:03                     ` John Perry
2021-04-01  6:45                       ` Emmanuel Briot [this message]
2021-04-01 13:38                       ` Niklas Holsti
2021-04-02 16:07                         ` John Perry
2021-03-22 17:39 ` Dmitry A. Kazakov
2021-03-22 17:45   ` John Perry
2021-03-22 18:07     ` Dmitry A. Kazakov
2021-03-22 18:23       ` John Perry
2021-03-22 20:30         ` Dmitry A. Kazakov
2021-03-22 18:59 ` Niklas Holsti
2021-03-22 21:54   ` John Perry
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox