Re: Simultaneous destructors

Chris Jones <[email protected]>
Newsgroups gmane.comp.mozilla.devel.dom
Message-ID <[email protected]>
Chris Jones wrote:
>> So we're looking at 3 IPC messages in a row, for a small HTTP reply
>> that comes in with one socket read().  One possibility is that we can
>> send them all in a row:
>>
>>     PARENT           CHILD
>>     -------------------------
>>     OnStart  --->
>>     OnData    --->
>>     OnStop     --->
>>
>> We still have the overhead of 3 IPC messages, but they can be "in
>> flight" at the same time.
>>
> 
> For all intents and purposes, we can treat the overhead of these 3 
> messages as the same as sending only 1.  (The overhead should be about 
> the same already, and if it's not, then it's easy to optimize away.)
> 

I just did two basic tests of IPC latency on my machine.  The first was 
a ping/pong test that measured the time of

   Parent           Child
-------------     ------------
  start timer
  SendPing
                    RecvPing
                    SendPong
  RecvPong
  stop timer

On my machine, this round-trip takes about 200 microseconds.

The second test was a multi-ping/pong, measuring

   Parent           Child
-------------     ------------
  start timer
  SendPing
  SendPing
  SendPing
  SendPing
  SendPing
                    RecvPing
                    SendPong
  RecvPong          RecvPing
                    SendPong
  RecvPong          RecvPing
                    SendPong
  RecvPong          RecvPing
                    SendPong
  RecvPong          RecvPing
                    SendPong
  RecvPong
  stop timer

(The stuff after the SendPing's happens concurrently in an undefined 
order, that diagram is for illustration purposes only.)

On my machine, this takes about 400 microseconds.

So I'm comfortable sticking by the assertion that sending 3 consecutive, 
overlapping async messages is basically free compared to sending only 1.

Cheers,
Chris
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.