**OK, here's my situation :**

* I have a function - let's say `U64 calc (U64 x)` - which takes a 64-bit integer parameter, performs some CPU-intensive operation, and returns a 64-bit value
* Now, given that I know ALL possible inputs (the `x`s) of that function beforehand (there are some 16000 though), I thought it might be better to pre-calculate them and then fetch them on demand (from an array-like structure).
* The ideal situation would be to store them all in some array `U64 CALC[]` and retrieve them by index (the `x` again)
* And here's the issue : I may know what the possible inputs for my calc function are, but they are most definitely **NOT consecutive** (e.g. not from 1 to 16000, but values that may go as low as 0 and as high as some trillions - always withing a 64-bit range)

**E.G.**

```
  X        CALC[X]
-----------------------
  123123   123123123
  12312    12312312
  897523   986123

  etc.

```

**And here comes my question :**

* How would you store them?
* What workaround would you prefer?
* Now, given that these values (from `CALC`) **will have to be accessed some thousands-to-millions of times, per sec**, which would be the best solution performance-wise?

---

***Note** : I'm no mentioning anything I've thought of or tried so as not to turn the answers into some debate of A vs B type-of-thing, and mostly not influence anyone...*