Thanks for the info. Hmmm.. interesting, I should read Knuth and think about the alternatives. And read V8 code to understand its hash management, and array implementation.
"big integer set implementation" refers, in my jargon, to an sparse array, possible implemented as a tree.
The best way to describe my intention is with code:
BigArray able me to have an array with a value under key 1, and under key 1000000, without allocating all the intermediate values. I don't know if V8 has a similar internal implementation, is it? Apparently, yes. I just tried in node
var arr = []
arr[1] = 1
arr[40000000] = 2
arr[400000000] = 3
To implement SortedSet a la Redis, I should have an efficient way of traversing the existing index key in numerical order, and that BigArray implementation give me that feature. How to retrieve the "used keys" in the about array? Or maybe I should revert to objects with keys?
In some operations, I need to retrieve the last 100 keys, or the first 100 keys.
Then, after that, I want to implement in Javascript a BitArray (code in above link). Using a BigArray of bytes in C# (long I presume in Javascript), I can turn on or off a bit (addresses by bit position, that is, bit #17 is the bit #2 in the second byte of the BigArray).
To emulate Redis
sadd myset 1 // add 1 to set my set
I want to use a BitArray
To emulate Redis
set users:1 "adam"
I want to have associated to "users" a BigArray, and "adam" fit in the slot 1. That is the reason to have a structured key. An activity feed of message to that user, could be then implemented with
sset users:1:messages 120345
internally object referenced by key users:1:messages is a bit set.
But enough Redis emulation for this list ;-). I will think about your suggestion for flat keys.
It's a pet project, but interesting for me.
Not know limit for memory in 64 bits? I just found
Any memory limit not related to hardware?