Re: g_strjoinv() is very slow

On Sat, Sep 23, 2000 at 08:17:01PM +0100, Joel Becker wrote:
> On Sat, Sep 23, 2000 at 06:51:48PM +0200, David Odin wrote:
> > On Sat, Sep 23, 2000 at 12:40:32PM -0400, Havoc Pennington wrote:
> >    I also think the same optimisations could be done with g_strjoin() and
> > g_strconcat(). I'll have a look.
> 	Maybe I'm a pedant, but I suspect we should find out what other
> platforms perform like.  I know that lots of them use inline ASM for
> these functions.  Maybe a test case in configure to decide?
  Here is my point:
   To perform a strcat(), you have to first find the end of the first string,
and then copy the second one in that place. It will always be slower than
only perform the copy.
   OK. In my algorithm, I use strlen(), but it is only used on the added
string, which is obviously shorter than the resulting one.

   Nevertheless, if you can point an architecture where the old g_strjoinv()
is faster than my implementation, I would be happy to learn (and to have a
look at the generated assembly code ;-)



David Odin bigfoot com

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]