[omniORB] Performance of Sequences

David Sansom david.sansom@db.com
Tue, 22 Aug 2000 09:40:53 +0000


Hi Thorsten,

Thanks for your suggestions. I have moved to the octet sequence but this hasn't made any difference. This is the skeleton code that I am using for the client / server : (server on Solaris, client on NT)

The IDL is:
interface Fred
{
  typedef sequence<octet> ResultSet;

  long ginger(in string strSql, out ResultSet results);
};

With the server-side implementation as:

long FredImpl::ginger(const char * strSql, ResultSet * & results)
{
  long lBufSize = 100 * 1024; //Some big buffer

  //Create a buffer
 CORBA::Octet * pbuf = Fred::ResultSet::allocbuf(lBufSize);

  // Fill buffer with something eg results of underlying db query
  ...
  //

  //Create sequence using buffer (passing ownership)
  results = new Fred::ResultSet(lBufSize,lBufSize,pbuf,1);

  return lBufSize;
}

On the Client side:

...
ResultSet * prs;
CORBA::Long l = objFred->ginger("Some Sql",prs);
...

My example timings give 7 secs for the client-side objFred->ginger() call, whilst the server spends around 3 secs within the Fred::ginger() implementation. The remaining 4 secs is spent transmitting & marshalling the return sequence.

Regards,


DS.





---------------------------------------- Message History ----------------------------------------


From: glowstars@gmx.de on 21/08/2000 18:51

To:   David Sansom/DMGGM/DMG UK/DeuBa@DMG UK
cc:   omniorb-list@uk.research.att.com; omniorb-list@uk.research.att.com
Subject:  Re: [omniORB] Performance of Sequences



David Sansom wrote:

> Maybe I'm doing something wrong, but I am now tempted to revert to my
> dog-eared copy of 'UNIX Network Programming' by Stevens and wave a sad
> farewell to Corba (!)

It's difficult to give an advice without a glimpse on your code.
Some tips that might be helpful:

- When you construct a sequence variable, supply an anticipated
  maximum number of elements using the maximum constructor.  If the
  sequence has some idea of the expected number of elements, it can
  chunk memory allocations more efficiently

- If you are really transmitting binary data, use sequence<octet>
  instead of sequence<char>. All basic types except octet are subject
  to changes in representation as they are transmitted between clients
  and servers.  Have a look at what the data constructor for sequences
  does (H&V, p.187f)

- Keep in mind that your entire result sequence must be buffered in
  memory during call dispatch, so eventually the operation will fail
  because of memory limitations.  Consider the use of Iterators (either
  a pull iterator or a push iterator; H&V, p.800f)

Cheers,

Thorsten Roskowetz

--
Sent through GMX FreeMail - http://www.gmx.net






--

This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorised copying, disclosure or distribution of the material in this e-mail is strictly forbidden.