aboutsummaryrefslogtreecommitdiffstats
path: root/system/doc/efficiency_guide
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2016-12-20 14:36:25 +0100
committerSverker Eriksson <[email protected]>2016-12-20 14:36:25 +0100
commit9a048a8743c3d384b5e33d6383be97dc4858126e (patch)
treeb620f9373287832c9ebb3e04ce9062b5d45b888a /system/doc/efficiency_guide
parent01c893ba18d524cd4868533b79ae2dd8bc395e7e (diff)
downloadotp-9a048a8743c3d384b5e33d6383be97dc4858126e.tar.gz
otp-9a048a8743c3d384b5e33d6383be97dc4858126e.tar.bz2
otp-9a048a8743c3d384b5e33d6383be97dc4858126e.zip
erts: Correct memory footprint for maps
Small map was wrong as we should include our own top Eterm and exclude them for keys and values. Large maps was wrong as it described the theoretical minimum of a full tree, which does not happen in reality.
Diffstat (limited to 'system/doc/efficiency_guide')
-rw-r--r--system/doc/efficiency_guide/advanced.xml12
1 files changed, 6 insertions, 6 deletions
diff --git a/system/doc/efficiency_guide/advanced.xml b/system/doc/efficiency_guide/advanced.xml
index eee2648f34..e1760d0ded 100644
--- a/system/doc/efficiency_guide/advanced.xml
+++ b/system/doc/efficiency_guide/advanced.xml
@@ -87,15 +87,15 @@
</row>
<row>
<cell>Small Map</cell>
- <cell>4 words + 2 words per entry (key and value) + the size of each key and value pair.</cell>
+ <cell>5 words + the size of all keys and values.</cell>
</row>
<row>
- <cell>Large Map</cell>
+ <cell>Large Map (> 32 keys)</cell>
<cell>
- At least, 2 words + 2 x <c>N</c> words + 2 x log16(<c>N</c>) words +
- the size of each key and value pair, where <c>N</c> is the number of pairs in the Map.
- A large Map is represented as a tree internally where each node in the tree is a
- "sparse tuple" of arity 16.
+ <c>N</c> x <c>F</c> words + the size of all keys and values.<br></br>
+ <c>N</c> is the number of keys in the Map.<br></br>
+ <c>F</c> is a sparsity factor that can vary between 1.6 and 1.8
+ due to the probabilistic nature of the internal HAMT data structure.
</cell>
</row>
<row>