Programming with Judy

Using Judy
Using JudyL
Chapter 342
Index = ~0;
JudyLLast(PJArray, &Index, 0);
(void) printf(" last random generated: 0x%08x\n", Index);
exit(0);
/*NOTREACHED*/
} // main()
Sample output
$ funhist 10000000
JudyL demonstration: random(3M) histogram
timing random number generation
It took 0.416 sec to generate 10000000 random numbers
(ie. 0.042 uSec/number)
Please wait while the random numbers are inserted into
a JudyL array (with a usage count) ...
That took 1.619 uSec/Index.
There were 10000000 unique random numbers generated
It took 76.000 uSec to count them in the Judy array.
Compute the random number distribution by counting index
ranges.
311914 unique values from 0 - 3ffffff
311770 unique values from 4000000 - 7ffffff
311556 unique values from 8000000 - bffffff
312178 unique values from c000000 - fffffff