http://blog.frama-c.com/index.php?post/2013/03/13/indetermin...
If so, then this isn't actually a problem in the case of sparse sets. With sparse sets we don't care what is in the uninitialised memory and if the compiler wants to get tricky and choose values for this memory (which I don't think actually applies in this context) that doesn't change the correctness of the data structure..
The sparse array in the OP can't be optimized in this way at compile time.
Also, initialising the space doesn't take so long; REP STOS on x86 is fast since it can write an entire cache line at once: http://ptspts.blogspot.ca/2014/10/on-speed-of-memset.html
One data structure can't be the best for every situation. It's why they pay engineers the big ducks [sic].
[1]http://svn.python.org/projects/python/trunk/Misc/README.valg...
http://upcoder.com/9/fast-resettable-flag-vector/
This is designed for a fast clear, but doesn't actually have constant time clear, it's just O(n) clear with very small (amortized) constant. It's a bit more cache friendly, though, I think, and gave us some nice speedups in practice.
Update: I remembered that the algorithm had something to do with checking if an item is not in a set, which quickly led me to Bloom Filter - not particularly similar, as it turns out.