Re: CORBA::string_dup
Duncan Grisby <[email protected]> Mon, 06 Oct 2003 16:23:48 +0100
| Newsgroups | gmane.comp.corba.omniorb.devel |
|---|---|
| Message-ID | <[email protected]> |
On Friday 26 September, Serguei Kolos wrote: > I have noticed that the CORBA::string_dup function uses strcpy to copy > strings. > Unfortunately on many systems strcpy is much slower then for example > memcpy. > For example on Linux (RedHat 7.3) the strcpy is 5 (sic!) times slower. Really? Wow! I wonder what it's doing. > What do you think about the idea of using the memcpy in the > CORBA::string_dup instead of the strcpy? Are there any drawbacks > with the memcpy? I suspect that on other platforms memcpy might be slower than strcpy. Something to try is to replace the call with the obvious for loop. Between omniORB 3 and 4 I did some profiling and found that strcmp was stupidly slow, and by far the fastest thing was an inline function with a for loop. It will probably be the same with strcpy. Cheers, Duncan. -- -- Duncan Grisby -- -- [email protected] -- -- http://www.grisby.org --