Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
Programming with Judy: C LanguageJudy Version 4.0 > Chapter 1 About Judy

When To Use Judy

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Glossary

 » Index

Designing programs with an unbounded array paradigm is one of the most powerful uses of Judy. Use Judy when your program requires:

  • Sparse arrays with dynamic or unbounded indexes (0, 1, 2... n)

  • The ability to scale effortlessly for future growth

  • Fast search and retrieval

  • Fast counting and sorting

  • Good performance across various types of index sets: sequential, periodic, clustered, and random

  • Memory efficiency: a low byte-per-index ratio for any array population

  • Nearly linear performance from very small to very large populations

Array types

Judy offers three types of arrays:

  • Judy1 functions provide a way to store, retrieve, and locate Boolean values (bit maps) in a Judy array. See “Using Judy1” for more information.

  • JudyL functions provide a way to store, retrieve, and locate long-word values in a Judy array. See “Using JudyL” for more information.

  • JudySL functions provide a way to store, retrieve, and locate strings as indexes (similar to associative arrays in awk, Perl and Java). See“Using JudySL” for more information.

Judy libraries

The table below shows the location of the libraries that are provided with the Judy technology on the HP-UX system:

Hardware Architecture

Type

Location on system (from root)

32-bit

64-bit

HP-PA 1.1
(32-bit only)

archive

/usr/lib/libJudy.a

N/A

shared

/usr/lib/libJudy.sl

N/A

HP-PA 2.0

archive

none

/usr/lib/pa20_64/ libJudy.a

shared

/usr/lib/pa20_32/libJudy.sl

/usr/lib/pa20_64/libJudy.sl

NOTE: The 32-bit HP-PA 1.1 shared library (/usr/lib/libJudy.sl) is provided for compatibility only. For best performance on 32-bit machines, use the HP-PA 2.0 shared library (/usr/lib/pa20_32/libJudy.sl).

Development history

The Judy code has been tested and improved over several internally available iterations at HP. The most recent version runs about twice as fast as the previous version. This version of Judy was designed to maintain very good memory allocation of not more than 12 bytes per index for 32-bit machines and 24-bytes per index for 64-bit machines. In fact, for large populations of clustered data, memory efficiency can be less than 8 bytes per index on a 32-bit machine or 16 bytes per index on a 64-bit machine.

The Judy concept has been generating engineering interest at HP for years with early research and prototyping dating back to 1981. The current Judy technology has been under active engineering development for four years. Judy has been proven in several internal HP tools and products, including a performance profiling tool, a disk work-load analyzer (WLA), and the OpenGL (Graphics Library). (See Appendix A “Where Did Judy Come From?”.)

Judy is a technology with patents pending that was invented and implemented by Hewlett-Packard.

In summary

Judy can replace many commonly used data structures: arrays, sparse arrays, hash tables, B-trees, binary trees, linear lists, skiplists, and counting functions. Judy is designed to:

  • Scale dynamically for future program requirements.

  • Handle large, unbounded array structures particularly well with performance that is almost linear across large populations.

  • Provide fast, built-in sorting and counting.

  • Increase productivity through an easy-to-use API.

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© Hewlett-Packard Development Company, L.P.