I have a machine with tons of memory. I have a golang µService that uses some memory. I have an option to choose from A) store that memory in a an array (contigous memory), or B) in a tree.
Does the face that the tree does not need contiguous memory, influence my decision ? The machine should have enough memory to store what I need in an array, this is not a factor. Is there perhaps a default max memory limit set by Golang ?
I declare a large array, that happens to be larger than my RAM, what would happen ? It should not crash, but only parts of it would be loaded in RAM at the same time.
I too think that for large data which can be stored both in an slice or a tree, the slice will have another advantage, its cache locality will matter less, as 2 logically close items will not be close in memory (the children of a tree node are not close in the large slice).