On Thu, Jun 16, 2016 at 4:59 PM, Dan Kortschak <dan.kortsc...@adelaide.edu.au> wrote: > I'm running a terabyte-scale (minor compiler changes are necessary to get > this to run) genome resequencing simulation at the moment and an interesting > question has arisen. > > The simulation involved hashing over ~all positions of a genome, either with > the key being a string or a [2]string. The difference in the resident memory > size for the entire program for these two cases is about a factor of two. > > What is an estimate of the contribution of key size to the number of bytes > required per element for a map?
A map is primarily an array of buckets. A bucket is 8 bytes followed by 8 keys followed by 8 values. So, in general, doubling the key size will double the memory requirements of the map. Ian -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.