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.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,d4226ffde2290b0c X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!postnews.google.com!v30g2000yqm.googlegroups.com!not-for-mail From: Gautier write-only Newsgroups: comp.lang.ada Subject: Re: Performance of the Streams 'Read and 'Write Date: Fri, 30 Oct 2009 01:58:15 -0700 (PDT) Organization: http://groups.google.com Message-ID: <0554a812-076a-4d89-8ec4-fcbc27e25804@v30g2000yqm.googlegroups.com> References: NNTP-Posting-Host: 206.122.158.4 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: posting.google.com 1256893095 14735 127.0.0.1 (30 Oct 2009 08:58:15 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 30 Oct 2009 08:58:15 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: v30g2000yqm.googlegroups.com; posting-host=206.122.158.4; posting-account=gRqrnQkAAAAC_02ynnhqGk1VRQlve6ZG User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/532.0 (KHTML, like Gecko) Chrome/3.0.195.27 Safari/532.0,gzip(gfe),gzip(gfe) Xref: g2news2.google.com comp.lang.ada:8880 Date: 2009-10-30T01:58:15-07:00 List-Id: On 30 Okt., 01:39, "Jeffrey R. Carter" wrote: > And if you overlay the Stream_Element_Array onto the Buffer, thus eliminating > the copying and the stream attribute operations? With an Unchecked_conversion ?... Sure, but you cannot guarantee that the Buffer will be packed the same way as Stream_Element_Array on a compiler X that you don't know. On that type of project (open-source compression, no compiler/system dependency) I want to avoid any "dirty trick" like that. Anyway, the copying takes almost no time. Note that I do not copy _and_ use the stream attribute at the same time: Variant 1 uses the stream attribute on Buffer. Variant 2 copies into a Stream_Element_Array ans uses the Write procedure in Ada.Streams. Gautier