From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Performance of records with variant parts
Date: Mon, 22 Mar 2021 19:07:03 +0100 [thread overview]
Message-ID: <s3amc3$1eaq$1@gioia.aioe.org> (raw)
In-Reply-To: b2408cae-884d-4b84-8152-d4d41a5aa5cen@googlegroups.com
On 2021-03-22 18:45, John Perry wrote:
> On Monday, March 22, 2021 at 12:39:54 PM UTC-5, Dmitry A. Kazakov wrote:
>> On 2021-03-22 18:02, John Perry wrote:
>>
>>> Is there a reason that the record with variant parts runs so much slower? I can make the complete source available if need be.
>> It must check the discriminant if the object is dynamically constrained.
>
> I'm not quite sure I understand. Are you saying that it has to check the discriminant at run-time?
Yes, if the field is in the variant part and the discriminant cannot be
statically deduced to indicate that part [or not, so that it could
always raise Constraint_Error]
> How would that differ from checking the value if it were merely a field of the record?
The field is always there. I think if you made it an Unchecked_Union you
would have no penalty (and no safety).
--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de
next prev parent reply other threads:[~2021-03-22 18:07 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
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 [this message]
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