comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: GNAT.Sockets Streaming inefficiency
Date: Thu, 8 Jun 2017 16:46:51 +0200
Date: 2017-06-08T16:46:51+02:00	[thread overview]
Message-ID: <ohbo0o$7gs$1@gioia.aioe.org> (raw)
In-Reply-To: c00a464f-5587-4a8e-a11a-589f7030127a@googlegroups.com

On 08/06/2017 12:36, masterglob@gmail.com wrote:
> Configuration: X64, Linux & Windows (GNATPRO 7.4.2)
> While using GNAT.Sockets.Stream_Access, there is a real performance issue while using String'Output(...).
> 
> My test sends 500 times a 1024-long String using String'Output(TCP_Stream on 127.0.0.1) and the result is:
> - Linux : average 'output duration = 3 us
> - Windows: average 'output duration = 250 us
> 
>  From prior discussion with AdaCore, the "String" type is the only one for which this latency is NOT observed on Linux.
> 
> Any idea on:
> - is there a way to get similar performance on Windows (maybe using another type or method?)
> - is there any configuration that may solve this issue?

As a rule you should never use socket stream, especially if you are 
concerned about latencies. Because then you should have used NO_DELAY 
option on the sockets at the both sides. You would send full protocol 
packets (which with NO_DELAY set become frames). Consequently you would 
use Send_Socket once the packet is in the output buffer 
(Stream_Element_Array).

P.S. If you use socket stream then do stream's Write operation.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de


  reply	other threads:[~2017-06-08 14:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-08 10:36 GNAT.Sockets Streaming inefficiency masterglob
2017-06-08 14:46 ` Dmitry A. Kazakov [this message]
2017-06-08 15:39 ` Robert Eachus
2017-06-09 13:30 ` gautier_niouzes
2017-06-09 15:24   ` Dmitry A. Kazakov
2017-06-19  9:22     ` masterglob
replies disabled

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