From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,213fbc70eb225c16 X-Google-Attributes: gid103376,public From: jeffrey.m.creem@lmco.com (Jeff Creem) Subject: Re: 'others' - inefficient esp. DEC Ada? [1/1] Date: 1997/10/14 Message-ID: #1/1 X-Deja-AN: 280441854 Distribution: world References: <+3g7rFB7dIQ0EwNI@RK-COMP.DEMON.CO.UK> Organization: Jeff Creem Newsgroups: comp.lang.ada Date: 1997-10-14T00:00:00+00:00 List-Id: In article <+3g7rFB7dIQ0EwNI@RK-COMP.DEMON.CO.UK>, Rob Kirkbride wrote: > >This is because using the 'others' the array is built up in another part >of memory before being copied back to My_Array, apparently because >Null_Element could be a function and it may raise a constraint error. > >Apart from the performance this also costs in memory as if this is done >in a task, the stack size of the task could have to be doubled to cope. >In one task this causes us to add 3Mb to the task size! > Note that most comopilers I have seen do the same thing with any sort of aggregate assignment (that is a copy is built on the stack and then the structure is copied back to the final destination). This has lead to us not using aggregate assignment as much as I would like since we often can't take the hit in either stack size or processing time. There will be some who say that this matters less as processors get faster (people have been saying that since ...forever) but I can tell you that this will continue to cause aggregate to be used less than I'd like for a very long time. Jeff