From: Ted Dennison <dennison@telepath.com>
Subject: Re: Thoughts on the recent ICFP contest
Date: Thu, 12 Sep 2002 16:43:50 GMT
Date: 2002-09-12T16:43:50+00:00 [thread overview]
Message-ID: <3D80C452.90608@telepath.com> (raw)
In-Reply-To: 3D80A356.93042472@despammed.com
Wes Groleau wrote:
>
>>>to transmit an entire buffer at once, rather than one component at a
>>
>> Like marshalling all those 'Writes to a buffer, then making one
>>socket'write(buffer) call?
>
>
> Have I missed the point all this time?
> I thought that 'Write recursively used
> all the component 'Writes to pack the
> object into a stream, and then the
> possibly dispatching operations of the
> stream would determine the method of
> transmission.
As a point of reference, perhaps you should see this post:
http://groups.google.com/groups?q=streams+stream_io+group:comp.lang.ada+author:dennison%40telepath.com&hl=en&lr=&ie=UTF-8&oe=UTF-8&selm=94hjbp%24ks6%241%40nnrp1.deja.com&rnum=4
from a couple of years ago.
The issue is that each 'Write on a "leaf object" (a non-compound object)
will result in its own call to the stream's Write routine. That means if
I do a 'Write on a 1K string, the stream's Write routine gets called
1024 times. That's a lot of overhead, not to mention that many stream
objects might be way more efficient with one Write of 1K than they are
with 1024 one-byte writes. That is certianly the case with Gnat's
Ada.Streams.Stream_IO
This issue has come up here many times before. The answer is always that
the user should either call the stream's Write routine themselves
directly with the entire buffer, or overload their object's 'Write
attribute with their own routine that does that.
I'm thinking it would be nice to have an object that does this for you,
rather than everyone always having to go out and write this same code.
next prev parent reply other threads:[~2002-09-12 16:43 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-09-12 2:35 Thoughts on the recent ICFP contest Ted Dennison
2002-09-12 3:11 ` tmoran
2002-09-12 14:23 ` Wes Groleau
2002-09-12 16:43 ` Ted Dennison [this message]
2002-09-12 16:53 ` David C. Hoos
2002-09-16 20:41 ` Wes Groleau
2002-09-17 3:21 ` Ted Dennison
2002-09-12 19:15 ` tmoran
2002-09-12 16:32 ` Ted Dennison
2002-09-12 19:15 ` tmoran
2002-09-13 1:45 ` Ted Dennison
2002-09-13 15:46 ` Warren W. Gay VE3WWG
2002-09-17 10:36 ` Jacob Sparre Andersen
2002-09-17 12:55 ` Ted Dennison
2002-09-17 14:41 ` Jacob Sparre Andersen
2002-09-17 10:56 ` Preben Randhol
2002-09-17 12:38 ` Ted Dennison
2002-09-18 0:31 ` tmoran
2002-09-18 7:15 ` Samuel Tardieu
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox