3 ms·
I think the problem with using offheap for something like this is that it requires you to specify the exact size of the data you want to put in each "cell" of t
by iAmCyclic 11y ago
I think the problem with using offheap for something like this is that it requires you to specify the exact size of the data you want to put in each "cell" of the hash table. Take a look at the NewHashFileBacked function in https://github.com/glycerine/offheap/blob/master/offheap.go https://github.com/glycerine/offheap/blob/master/offheap.go. If you wanted to cache a variety of json data this could lead to a lot of unused space if most of the items are smaller than the cell size. So, their large byte array plus offsets solution seems preferable.
I do agree with you that perhaps Golang was not the right choice for this project since they spent much of the time working around features of the language.