FAQ

On Tuesday, 3 May 2016 14:13:39 UTC+3, Christian von Kietzell wrote:
Hi Go nuts,

would it be a terribly bad idea to have a map with millions of keys? In my
case those keys would be short to medium-length strings (anything from 1 to
about 20 characters). Values would be slices of int64.

If that could provoke the GC to show less-than-optimal behaviour what are
some possible alternatives?
It's hard to suggest really good optimizations based on an abstract
problem. Even the characters and values in the slices may suggest a better
data-structure that is not possible in the generic case.

In other words, can you show a sample of the data or a program that
generates a representative dataset, (so that the character distribution,
length distribution, value distributions are good). Then also include how
the dataset is accessed, how often iterated, modified etc.
(see https://github.com/golang/go/wiki/HowToAsk).

As a general suggestion, do the stupid thing first, measure -> if it's good
enough, proceed with more important problems :)

+ Egon

--
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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 5 of 10 | next ›
Discussion Overview
groupgolang-nuts @
categoriesgo
postedMay 3, '16 at 11:13a
activeMay 4, '16 at 1:51a
posts10
users10
websitegolang.org

People

Translate

site design / logo © 2021 Grokbase