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 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!news3.google.com!proxad.net!feeder1-2.proxad.net!feeder.erje.net!news.tornevall.net!not-for-mail From: "Jeffrey R. Carter" Newsgroups: comp.lang.ada Subject: Re: Performance of the Streams 'Read and 'Write Date: Thu, 29 Oct 2009 17:39:39 -0700 Organization: TornevallNET - http://news.tornevall.net Message-ID: References: NNTP-Posting-Host: e9df5f017fa52cabcba383c23d7bb66a Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: 6e3c378048dbceadd4f8089fd4f3d3a8 X-Complaints-To: abuse@tornevall.net X-Complaints-Language: Spoken language is english or swedish - NOT ITALIAN, FRENCH, GERMAN OR ANY OTHER LANGUAGE! In-Reply-To: X-Validate-Post: http://news.tornevall.net/validate.php?trace=6e3c378048dbceadd4f8089fd4f3d3a8 X-SpeedUI: 1738 X-Complaints-Italiano: Parlo la lingua non � italiano User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) X-Posting-User: 9b22bfe2855937f9b3faeec7cfc91295 Xref: g2news2.google.com comp.lang.ada:8869 Date: 2009-10-29T17:39:39-07:00 List-Id: Gautier write-only wrote: > > Naively, you would say it is even slower: you do even more by copying > a buffer into another one, right ? > Indeed, not at all, it is *lots* faster (on GNAT and ObjectAda)! > To give an idea, the variant 1 applied to a bzip2 decompressor makes > it 4x slower than the C version, and variant 2 makes it only 7% > slower! With only I/O (like copying a file) you would get an even much > larger difference. And if you overlay the Stream_Element_Array onto the Buffer, thus eliminating the copying and the stream attribute operations? -- Jeff Carter "C's solution to this [variable-sized array parameters] has real problems, and people who are complaining about safety definitely have a point." Dennis Ritchie 25