Perché SortEdDictionary ha bisogno di così tante spese generali?
-
12-11-2019 - |
Domanda
long b = GC.GetTotalMemory(true);
SortedDictionary<int, int> sd = new SortedDictionary<int, int>();
for (int i = 0; i < 10000; i++)
{
sd.Add(i, i+1);
}
long a = GC.GetTotalMemory(true);
Console.WriteLine((a - b));
int reference = sd[10];
output (32 bit):
280108
output (64 bit):
480248
La conservazione dell'INTS da solo (in un array) richiederebbe circa 80000.
Nessuna soluzione corretta
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow