Hi Itamar,
you may have a look at the source code for the empty function at
Probably the interesting code is this:
   case HB_IT_STRING:
   case HB_IT_MEMO:
     hb_retl( hb_strEmpty( hb_itemGetCPtr( pItem ), hb_itemGetCLen( pItem ) ) );
     break;
The definition of empty() for strings is that it should return .T. for a string like "" or a string like space(1000000).
And the only way to check if a string of a given len is really "empty" is to check every byte,,,
HB_BOOL hb_strEmpty( const char * szText, HB_SIZE nLen )
{
  HB_TRACE( HB_TR_DEBUG, ( "hb_strEmpty(%s, %" HB_PFS "u)", szText, nLen ) );
  while( nLen-- )
  {
   char c = szText[ nLen ];
   if( ! HB_ISSPACE( c ) )
     return HB_FALSE;
  }
  return HB_TRUE;
}
So, in case of a empty("") nLen is 0, the while loop is never ever run, HB_TRUE is returned immediately.
In case of empty( space(10000000)), nLen is
10000000
and each byte is checked by HB_ISSPACE macro, that expands to:
#define HB_ISSPACE( c ) Â Â Â Â ( ( c ) == ' ' || \
                 ( c ) == HB_CHAR_HT || \
                 ( c ) == HB_CHAR_LF || \
                 ( c ) == HB_CHAR_CR )
then we have:
#define HB_CHAR_HT Â Â Â Â Â Â Â '\t' Â Â /* Â 9 - Tab horizontal */
#define HB_CHAR_LF Â Â Â Â Â Â Â '\n' Â Â /* Â 10 - Linefeed */
#define HB_CHAR_CR Â Â Â Â Â Â Â '\r' Â Â /* Â 13 - Carriage return */
So spaces, tabs, linefeeds and carriage returns are all considered "blanks".
There are several tricks to speedup these checks using "recent" cpus, but the code will be architecture dependent.
Despite all these checks I think that it is almost impossible to see a difference between the 2 calls, but we should time it. Probably the most time is spent retrieving the data from the db. In case of browse you should check how many times the empty is called.Â
Francesco