Hi, I have no answers yet, but only questions:
Have you benchmarked this portion of code and are you sure this a bottleneck of your program ?
Have you tried to use a hash table provided by the standard library ?
So you want an integer set? DO you have any constraints on memory use?
Are those in a specific range like 0 ..< N?
You keep 2 arrays: one that maps a key to a position in a second array, the second arrays stores the actual value.
If you need this to be an "associative array" with "satellite data" as values for given keys, that is a straightforward extension where the dense array can be an array of pairs (or you could have a parallel dense value array).
At some slightly different point in the design space is Varghese's Aggregate Bit Vectors which do not allow associative extension, https://cseweb.ucsd.edu/~varghese/PAPERS/icnp2002.pdf , which is also pretty easy to implement.
And, of course, Table[int,int] is not actually that slow either.