Skip to content

Commit 8b63e3c

Browse files
committed
Update site
1 parent d981769 commit 8b63e3c

30 files changed

+495
-1441
lines changed

README!! renamed to README.md

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,22 @@ To generate PDF one has to install texlive packages.
1212

1313
sudo apt-get install texlive-latex-base texlive-fonts-recommended texlive-latex-extra
1414

15-
Than run
15+
Script also uses Maven to execute some code and verify tests.
1616

17-
./pdf
17+
sudo apt-get install maven
18+
19+
It might also depend on latest version of MapDB, so install it into local maven repo:
20+
21+
sudo apt-get install git
22+
git clone https://github.com/jankotek/mapdb.git
23+
cd mapdb
24+
mvn install -DskipTests=true
1825

26+
Finally generate html:
1927

20-
And generate html. It depends on PDF and MapDB source code. Result will be placed in _build/html
28+
./make.sh
2129

22-
make clean html
23-
24-
To publish local changes checkout `gh-pages` branch into `../gh-pages/` folder and run publish. It will ask for
25-
github login:
26-
27-
./publish
30+
And publish it (if you have a rights)
2831

32+
./publish.sh
2933

benchmark.properties

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#mapdb benchmark
2+
#Tue Mar 08 17:46:20 EET 2016
3+
BTreeMap_get=18495
4+
BTreeMap_heap_get=2425
5+
BTreeMap_heap_insert=5150
6+
BTreeMap_heap_update=4616
7+
BTreeMap_insert=38526
8+
BTreeMap_update=25582
9+
ConcurrentHashMap_get=217
10+
ConcurrentHashMap_insert=636
11+
ConcurrentHashMap_update=450
12+
ConcurrentSkipListMap_get=1592
13+
ConcurrentSkipListMap_insert=3022
14+
ConcurrentSkipListMap_update=1730
15+
HTreeMap_get=14895
16+
HTreeMap_heap_get=7021
17+
HTreeMap_heap_insert=12169
18+
HTreeMap_heap_update=8246
19+
HTreeMap_insert=21026
20+
HTreeMap_update=24809
21+
MapDB2_BTreeMap_get=18871
22+
MapDB2_BTreeMap_insert=40398
23+
MapDB2_BTreeMap_update=29766
24+
MapDB2_HTreeMap_get=22344
25+
MapDB2_HTreeMap_insert=31848
26+
MapDB2_HTreeMap_update=24202
27+
MapMemoryUsage\#BTreeMap=27800000
28+
MapMemoryUsage\#BTreeMap_heap=139500000
29+
MapMemoryUsage\#BTreeMap_pump=271900000
30+
MapMemoryUsage\#ConcurrentHashMap=44100000
31+
MapMemoryUsage\#ConcurrentSkipListMap=46700000
32+
MapMemoryUsage\#HTreeMap=40100000
33+
MapMemoryUsage\#HTreeMap_heap=60600000
34+
MapMemoryUsage\#MapDB2_BTreeMap=125800000
35+
MapMemoryUsage\#MapDB2_HTreeMap=20100000
36+
MapMemoryUsage\#SortedTableMap=291500000
37+
SortedTableMapBenchmark_get=4908
38+
org.mapdb.benchmark.ExpiryBench.createTTL=56032
39+
org.mapdb.benchmark.IndexTreeLongLongMapBench.create=3024

benchmarks.rst

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
In-memory benchmarks
2+
======================
3+
4+
This benchmark compares different Map implementations. We try to keep this test fair, no trick or extra tuning.
5+
Also dataset is small with no GC overhead.
6+
7+
Benchmark source is in `Github repo <https://github.com/jankotek/mapdb-benchmarks>`_.
8+
Please send Pull Request if you have improvements.
9+
All tests ran on Linux with 64bit JDK8.
10+
11+
Maps
12+
--------------
13+
14+
There are six maps in this test. All tests work on Map with 10 million entries to minimize GC overhead,
15+
Key is 8-byte long, value is 16-byte UUID.
16+
Small objects were chosen to better illustrate overhead of internal Map structures (nodes, hash table..)
17+
18+
HTreeMap is concurrent HashMap implementation from MapDB. It is optimized for bigger keys and large number of entries.
19+
It has some extra features such as entry expiration with TTL or maximal size.
20+
21+
BTreeMap is concurrent TreeMap implementation from MapDB. It is optimized for minimal space usage and for small keys.
22+
It has features to redoce memory and space usage.
23+
24+
MapDB serializes all data into in-memory binary store backed by ``byte[]``. This storage is not limited by GC
25+
and ``DirectByteBuffer`` version was tested on half-terabyte of memory.
26+
27+
There is also ``_heap`` mode where MapDB stores all data on-heap using pointers and object instances.
28+
There is no serialization involved.
29+
This mode is usually faster for smaller sets, but is limited by Garbage Collection.
30+
31+
Memory usage
32+
~~~~~~~~~~~~~~
33+
34+
This chart shows how much entries ``Map<Long,UUID>`` can fit into 5GB of heap memory.
35+
JVM starts with 5GB maximal heap size (``-Xmx5G``), entries are added until JVM terminates with ``OutOfMemoryException``.
36+
37+
.. centered:: **Number of entries inserted into Map with 5GB heap, before JVM runs out of memory (higher is better)**
38+
.. image:: target/charts/maps_memory_usage.png
39+
40+
ConcurrentHashMap and ConcurrentSkipListMap are bundled with Java. Their both consume about the same amount of memory.
41+
42+
BTreeMap should have in theory very good space usage. However underlying store is too fragmented after frequent updates,
43+
this bug should be solved soon. ``BTreeMap_pump`` shows best case for BTreeMap, with no fragmentation.
44+
45+
``BTreeMap_heap`` is on-heap version of BTreeMap. It uses specialized node representation
46+
(``Long[]`` and ``UUID[]`` are internally stored in ``long[]``) and that makes it space efficient.
47+
48+
HTreeMap is not yet optimized for space usage, no surprise here.
49+
50+
SortedTableMap is very space efficient after compaction.
51+
52+
53+
Random updates
54+
~~~~~~~~~~~~~~~~~
55+
56+
.. centered:: **Time to update 100M random keys on Map with 100M entries (smaller is better)**
57+
.. image:: target/charts/maps_update.png
58+
59+
``ConcurrentHashMap`` in this case rocks .
60+
61+
``HTreeMap`` and ``BTreeMap`` are relatively slow. Optimizations are planned for M4.
62+
63+
Random get
64+
~~~~~~~~~~~~~~~~~
65+
66+
.. centered:: **Time to get 100M random keys on Map with 100M entries (smaller is better)**
67+
.. image:: target/charts/maps_get.png
68+
69+
``ConcurrentHashMap`` rocks again.
70+
71+
``BTreeMap_heap`` takes advantage of specialization (it uses ``long[]`` instead of ``Long[]`` in BTree Nodes).
72+
73+
``HTreeMap`` and ``BTreeMap`` are relatively slow. Optimizations are planned for M4.
74+
75+
76+

benchmarks.rst!!

Lines changed: 0 additions & 102 deletions
This file was deleted.

0 commit comments

Comments
 (0)