comp.lang.ada
 help / color / mirror / Atom feed
From: hebisch@math.uni.wroc.pl (Waldek Hebisch)
Subject: Re: GNAT/Ada95 Streams Performance Issue
Date: 12 Aug 2002 15:09:49 GMT
Date: 2002-08-12T15:09:49+00:00	[thread overview]
Message-ID: <aj8j3t$bmn$1@panorama.wcss.wroc.pl> (raw)
In-Reply-To: 3D51ECC9.8020406@cogeco.ca

Warren W. Gay VE3WWG (ve3wwg@cogeco.ca) wrote:
: 3. The individual characters that make up Msg are written
:      out to stream S, using individual calls to Character'Write.

: Step # 3 is the performance killer.

: To help in this regard, APQ 1.2 (not released yet) now supports
: two new functions for performance reasons:

:       String_Output to substitute for String'Output
:       String_Input to substitute for String'Input

: These routines deal with the array of characters as
: one block of data.

: But this is really just a patch over part of a much
: larger problem.

: How have other people dealt with this type of streams
: performance issue?  Or do people generally avoid
: streams when performance is important?

Well, I just toyed with a simple cat program:

        loop
                Ada.Text_IO.Get_Line( Line, Last );
                Ada.Text_IO.Put_Line( Line(1..Last) );
        end loop;

Using GNAT (gcc 3.1.1), I get very bad performance (about 10 MB/s, raw 
system calls (in C) give 450MB/s). I looked at the sources, and while 
Put_Line essentialy outputs the block (it makes a copy and modifies it 
slightly) Get_Line works with single characters. The problem is that to 
cooperate nicely with C Ada has to go trough C stdio interface. Since Ada 
and C semantics differ Ada cannot use C block input. The problem is magnified 
becouse each C stdio function performs locking. 

--
                              Waldek Hebisch
hebisch@math.uni.wroc.pl    or hebisch@hera.math.uni.wroc.pl 



       reply	other threads:[~2002-08-12 15:09 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <3D51ECC9.8020406@cogeco.ca>
2002-08-12 15:09 ` Waldek Hebisch [this message]
2002-08-12 23:49   ` GNAT/Ada95 Streams Performance Issue Robert Dewar
2002-08-14 14:53     ` Waldek Hebisch
2002-08-13  1:22   ` Larry Hazel
2002-08-13  8:25     ` Robert Dewar
2002-08-13 13:45       ` Larry Hazel
2002-08-13 21:11         ` Robert Dewar
2002-08-14  8:58           ` Lutz Donnerhacke
2002-08-14 15:46 Mike Brenner
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox