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!v25g2000yqk.googlegroups.com!not-for-mail From: Gautier write-only Newsgroups: comp.lang.ada Subject: Re: Performance of the Streams 'Read and 'Write Date: Sat, 31 Oct 2009 16:46:32 -0700 (PDT) Organization: http://groups.google.com Message-ID: <43989e1e-36d0-45e2-9144-e7dae89d6200@v25g2000yqk.googlegroups.com> References: <0554a812-076a-4d89-8ec4-fcbc27e25804@v30g2000yqm.googlegroups.com> NNTP-Posting-Host: 85.0.79.12 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: posting.google.com 1257032792 18705 127.0.0.1 (31 Oct 2009 23:46:32 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sat, 31 Oct 2009 23:46:32 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: v25g2000yqk.googlegroups.com; posting-host=85.0.79.12; posting-account=gRqrnQkAAAAC_02ynnhqGk1VRQlve6ZG User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686; fr; rv:1.8.1.14) Gecko/20080612 Fedora/2.0.0.14-20080612.fc8.acer Firefox/2.0.0.14,gzip(gfe),gzip(gfe) Xref: g2news2.google.com comp.lang.ada:8928 Date: 2009-10-31T16:46:32-07:00 List-Id: On 30 oct, 20:12, "Jeffrey R. Carter" wrote: > >> And if you overlay the Stream_Element_Array onto the Buffer, thus eliminating > >> the copying and the stream attribute operations? > for S'Address use B'Address; Bingo! xxx'Write / xxx'Read (Stream attributes)................ 14.717895000 seconds Workaround with Stream_Element_Array buffer and copy.... 0.435756000 seconds Workaround with Stream_Element_Array buffer and overlay. 0.211830000 seconds Factor (Copy) 33.775541816 Factor (Overlay) 69.479747911 This on a Linux 32 bit netbook, with a 32 MB file; GNAT GPL 2009, - gnatp -O2. So my "almost no time" assumption about the buffer copy was definitely to be understood as "compared to the attribute version"... _________________________________________________________ Gautier's Ada programming -- http://sf.net/users/gdemont/ NB: For a direct answer, e-mail address on the Web site!