On 19/02/2014, at 3:51 PM, Alan Silverstein wrote:

> John etc,

John(s) :)

>  The macro API has confused people more
> than Doug ever intended, and made it even harder to code properly too.
> It seems to me that only "real experts" (who can handle the raw truth,
> even prefer it) end up seriously using libJudy.

Once you get the hang of it .. its not *that* hard to use the C API.
That's because the design is exactly right. It uses pointer values
where needed and pointers to pointers where needed:

1) If you're not modifying the array, use a void* = array.

2) If you are, use a void** = array*

3) If you're fetching a key or value, provide a pointer
to the place it can be put.

4) If you're modifying a value, you have to provide a pointer
to a slot that can hold a pointer to the slot IN the array, so you can store
a new value into the array. If your replace or insert fails,
you get a NULL stored there.

It's very precise. Once you understand it you do not need
the manual, you can calculate from first principles what
the API must be (more or less :)

As for killer apps .. that's the wrong idea. There are numerous
places in most code where Judy is the ONLY data structure
that can be used: 

A) Where the key is an integer or pointer
B) Where you need O(1) fast random AND sequential access

There isn't anything else. One vital property: it is perfectly
safe to iterate through a judy array and modify it as you go.
Try doing THAT with an STL container! 

The core restriction on Judy is that the key has to be a machine word
or a null terminated string. The value can be anything (just use a pointer).

Seriously, the thing I'd want to see next is a PURELY FUNCTIONAL
version of Judy. It would revolutionise the world. Functional
programming would actually be practical for the first time.

I'm not sure it can be done .. but functional code handles trees reasonably
well. We'd probably drop to O(log N) performance but it could be a very
fast O(log N)

--
john skaller
[email protected]
http://felix-lang.org




------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk
_______________________________________________
Judy-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/judy-devel

Reply via email to