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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,68494635acddb77e,start X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!f36g2000hsa.googlegroups.com!not-for-mail From: Maciej Sobczak Newsgroups: comp.lang.ada Subject: File output and buffering Date: Tue, 19 Aug 2008 13:27:00 -0700 (PDT) Organization: http://groups.google.com Message-ID: <60a35fd4-e5a6-4aa0-a73f-6815ce7e92fc@f36g2000hsa.googlegroups.com> NNTP-Posting-Host: 85.3.209.213 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: posting.google.com 1219177621 27190 127.0.0.1 (19 Aug 2008 20:27:01 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 19 Aug 2008 20:27:01 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: f36g2000hsa.googlegroups.com; posting-host=85.3.209.213; posting-account=bMuEOQoAAACUUr_ghL3RBIi5neBZ5w_S User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.0.1) Gecko/2008070206 Firefox/3.0.1,gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:1656 Date: 2008-08-19T13:27:00-07:00 List-Id: It seems to me that the file output in standard Ada library is not buffered: 1. There is no buffer-related operation in the whole library. 2. The semantics of output operations is defined in terms of the effects on external file. 3. The performance of simple test is consistent with what can be obtained in equivalent C code that flushes the channel after every operation (ie. some 15-20x slower than with default buffering). Let's suppose that I want to add buffering to my output. I can write the stream type that does the necessary magic, but how can I reuse the formatting machinery that is already available in Ada.Text_IO and related packages? -- Maciej Sobczak * www.msobczak.com * www.inspirel.com Database Access Library for Ada: www.inspirel.com/soci-ada