List:Commits« Previous MessageNext Message »
From:Sergei Golubchik Date:February 15 2008 6:03pm
Subject:Re: bk commit into 6.0 tree (gkodinov:1.2799) BUG#14637
View as plain text  
Hi!

On Feb 13, kgeorge@stripped wrote:
> ChangeSet@stripped, 2008-02-13 16:53:24+02:00, gkodinov@stripped +8 -0
>   Bug #14637: trim trailing spaces processes data only byte wise
>    Use and int * where possible to scan for trailing space in a
>    string instead of always iterating char-by-char.
>    Using the attached benchmark file on a 32 bit Intel Core 2 
>    Duo CPU I've got 43485 ms run with the fix compared to 44373 
>    without it.

almost ok, but one big problem, see below
 
> diff -Nrup a/include/m_string.h b/include/m_string.h
> --- a/include/m_string.h	2007-11-30 15:52:49 +02:00
> +++ b/include/m_string.h	2008-02-13 16:53:21 +02:00
> @@ -263,4 +263,6 @@ typedef struct st_mysql_lex_string LEX_S
>  #define USTRING_WITH_LEN(X) ((uchar*) X), ((size_t) (sizeof(X) - 1))
>  #define C_STRING_WITH_LEN(X) ((char *) (X)), ((size_t) (sizeof(X) - 1))
>  
> +inline const uchar *skip_trailing_space(const uchar *ptr,size_t len);

Sorry, it doesn't work that way. You need to define function in the
header, not just declare. The linker cannot inline a function, it must
be visible to a compiler that does compilation.

And declare it static:

static inline const uchar *skip_trailing_space(...)
{
 ...

>  #endif

Regards / Mit vielen Grüssen,
Sergei

-- 
   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /   Sergei Golubchik <serg@stripped>
 / /|_/ / // /\ \/ /_/ / /__  Principal Software Developer/Server Architect
/_/  /_/\_, /___/\___\_\___/  MySQL GmbH, Dachauer Str. 37, D-80335 München
       <___/                  Geschäftsführer: Kaj Arnö - HRB
München 162140
Thread
bk commit into 6.0 tree (gkodinov:1.2799) BUG#14637kgeorge13 Feb
  • Re: bk commit into 6.0 tree (gkodinov:1.2799) BUG#14637Sergei Golubchik15 Feb