Mauricio FernŠŌdez <batsman.geo / yahoo.com> wrote in message news:<20020828023514.GB19917 / kodos>...
> diff -rwdu ruby/configure.in ruby-judy/configure.in
> --- ruby/configure.in	Sun Aug 11 23:43:24 2002
> +++ ruby-judy/configure.in	Tue Aug 27 17:46:42 2002
> @@ -281,6 +281,7 @@
>  AC_CHECK_LIB(crypt, crypt)
>  AC_CHECK_LIB(dl, dlopen)	# Dynamic linking for SunOS/Solaris and SYSV
>  AC_CHECK_LIB(dld, shl_load)	# Dynamic linking for HP-UX
> +AC_CHECK_LIB(Judy, JudyLIns)	# Judy 

....deleted

Mauricio:

I am the author of Judy.  I just had a chance to look over this file.
Overall I am impressed.  I just heard of Ruby for the first time a
week or two ago.  It also looks like there has been discussion of
how this performs VS. the normal hashing routines in Ruby.  This
is good, I want know how the performance compares.  I am commited
to making Judy the fastest and most memory efficient method on the
Planet.

The first thing I noticed that could affect the performance of the 
Judy version is the lack of use of the Judy Macros --JLG() JLN(), 
JLI() etc.  It is obvious you read the JudyHashing application
note, but missed one of the very important parts.  The use of 
JLG() and JLN()are very important for the best performance at 
low populations of the Judy Array.  As a first cut change the 
lines:

                from:
	PValue = JudyLNext(table->PJLArray[i], &Index, PJE0);
                to:
        JLN(PValue, table->PJLArray[i], Index);

                from:
   PValue = JudyLGet(HASHARRAY(table,hash_val), bin_pos,PJE0);
                to:
   JLG(PValue,HASHARRAY(table,hash_val), bin_pos);

                from:
   ptr = (st_table_entry **) JudyLGet(HASHARRAY(table, hash_val), 
    			HASHINDEX(hash_val), PJE0);
                to:
   JLG(ptr, HASHARRAY(table, hash_val), HASHINDEX(hash_val);

The use of JLG and JLN should improve the performance of the retrieve
to be very competitive with the hash method used here.  Please let me
know how it goes.  I also have some other concerns, but I will talk
about that later. And while your at it, change all the JudyL* routines
to their macro counterparts.  I have designed the macros to give all
the flexibility in handling errors I think you need.

I am new to the open source community.  I am about to change the phrase
"faster than the speed of light" to "faster than the speed of the internet".

Doug Baskins <doug / sourcejudy.com>