[omniORB] performance problem increasing sequence length in a loop

Duncan Grisby duncan at grisby.org
Fri Nov 7 14:24:08 GMT 2008


On Thursday 6 November, Michael Teske wrote:

> We're trying (again) to port our system from Orbacus to
> omniORB. Unfortunately we have lots of code where sequences are
> resized dynamically, sometimes even in a loop (I know this is not the
> best style, but to find all these locations could become a nightmare).
>
> While something like this is very fast in Orbacus it becomes very slow
> in omniORB.  I think this isbecause Orbcaus doubles the reserved
> buffer if the new desired length is lower than the old length * 2,
> while omniORB just allocates the new length and copies the old
> sequence over *every* time.

You're right -- omniORB does not currently increase sequence buffers in
an incremental way, so code that repeatedly increases the length by one
will be O(n^2).

I'd welcome patches that implement a more efficient growth scheme. Make
sure your patches follow the existing code style.

Cheers,

Duncan.

-- 
 -- Duncan Grisby         --
  -- duncan at grisby.org     --
   -- http://www.grisby.org --



More information about the omniORB-list mailing list