Skip to content

Commit 1884d71

Browse files
committed
Updated performance test results
1 parent 053d9c2 commit 1884d71

File tree

14 files changed

+128
-86
lines changed

14 files changed

+128
-86
lines changed

README.md

Lines changed: 9 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -276,33 +276,19 @@ Performance
276276

277277
Performance measurements in Xcode on an iMac M1, release build.
278278

279-
### Worst case insert
279+
### Insert
280280

281-
The worst case is inserting random numbers on the right with the same left
282-
value. The one-to-many uses the optimized bulk insert. Results in milliseconds.
281+
The worst case is inserting random numbers on the right with the same left
282+
value. This test uses the optimized bulk insert. Results in milliseconds.
283283

284284
| | one-to-one | one-to-many | many-to-many |
285285
|-----------|------------|-------------|--------------|
286-
| 10 | 0.068333 | 0.152083 | 0.067542 |
287-
| 100 | 0.2425 | 0.209416 | 0.450292 |
288-
| 1,000 | 2.20312 | 1.26733 | 4.82071 |
289-
| 10,000 | 17.2593 | 8.92692 | 28.9023 |
290-
| 100,000 | 77.019 | 46.892 | 365.9 |
291-
| 1,000,000 | 739.4 | 662.998 | 21,592.2 |
292-
293-
### Best case insert
294-
295-
The “best case” is inserting random numbers on both the left and right. Results
296-
in milliseconds.
297-
298-
| | one-to-one | one-to-many | many-to-many |
299-
|-----------|------------|-------------|--------------|
300-
| 10 | 0.005542 | 0.005625 | 0.00575 |
301-
| 100 | 0.03325 | 0.042167 | 0.039875 |
302-
| 1,000 | 0.25875 | 0.306125 | 0.354167 |
303-
| 10,000 | 2.37317 | 2.64029 | 3.25633 |
304-
| 100,000 | 20.2791 | 18.3426 | 30.7384 |
305-
| 1,000,000 | 454.936 | 601.014 | 780.828 |
286+
| 10 | 0.09675 | 0.025583 | 0.032292 |
287+
| 100 | 0.245417 | 0.157959 | 0.180417 |
288+
| 1,000 | 2.04304 | 1.06521 | 1.58233 |
289+
| 10,000 | 15.3651 | 7.81887 | 10.4605 |
290+
| 100,000 | 83.5547 | 49.4451 | 76.5453 |
291+
| 1,000,000 | 764.227 | 665.519 | 933.844 |
306292

307293
### Lookup
308294

docs/_test_many_to_many_8h_source.html

Lines changed: 81 additions & 0 deletions
Large diffs are not rendered by default.

docs/index.html

Lines changed: 10 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -258,44 +258,25 @@ <h1><a class="anchor" id="autotoc_md10"></a>
258258
Performance</h1>
259259
<p>Performance measurements in Xcode on an iMac M1, release build.</p>
260260
<h2><a class="anchor" id="autotoc_md11"></a>
261-
Worst case insert</h2>
262-
<p>The worst case is inserting random numbers on the right with the same left value. The one-to-many uses the optimized bulk insert. Results in milliseconds.</p>
261+
Insert</h2>
262+
<p>The worst case is inserting random numbers on the right with the same left value. This test uses the optimized bulk insert. Results in milliseconds.</p>
263263
<table class="markdownTable">
264264
<tr class="markdownTableHead">
265265
<th class="markdownTableHeadNone"></th><th class="markdownTableHeadNone">one-to-one </th><th class="markdownTableHeadNone">one-to-many </th><th class="markdownTableHeadNone">many-to-many </th></tr>
266266
<tr class="markdownTableRowOdd">
267-
<td class="markdownTableBodyNone">10 </td><td class="markdownTableBodyNone">0.068333 </td><td class="markdownTableBodyNone">0.152083 </td><td class="markdownTableBodyNone">0.067542 </td></tr>
267+
<td class="markdownTableBodyNone">10 </td><td class="markdownTableBodyNone">0.09675 </td><td class="markdownTableBodyNone">0.025583 </td><td class="markdownTableBodyNone">0.032292 </td></tr>
268268
<tr class="markdownTableRowEven">
269-
<td class="markdownTableBodyNone">100 </td><td class="markdownTableBodyNone">0.2425 </td><td class="markdownTableBodyNone">0.209416 </td><td class="markdownTableBodyNone">0.450292 </td></tr>
269+
<td class="markdownTableBodyNone">100 </td><td class="markdownTableBodyNone">0.245417 </td><td class="markdownTableBodyNone">0.157959 </td><td class="markdownTableBodyNone">0.180417 </td></tr>
270270
<tr class="markdownTableRowOdd">
271-
<td class="markdownTableBodyNone">1,000 </td><td class="markdownTableBodyNone">2.20312 </td><td class="markdownTableBodyNone">1.26733 </td><td class="markdownTableBodyNone">4.82071 </td></tr>
271+
<td class="markdownTableBodyNone">1,000 </td><td class="markdownTableBodyNone">2.04304 </td><td class="markdownTableBodyNone">1.06521 </td><td class="markdownTableBodyNone">1.58233 </td></tr>
272272
<tr class="markdownTableRowEven">
273-
<td class="markdownTableBodyNone">10,000 </td><td class="markdownTableBodyNone">17.2593 </td><td class="markdownTableBodyNone">8.92692 </td><td class="markdownTableBodyNone">28.9023 </td></tr>
273+
<td class="markdownTableBodyNone">10,000 </td><td class="markdownTableBodyNone">15.3651 </td><td class="markdownTableBodyNone">7.81887 </td><td class="markdownTableBodyNone">10.4605 </td></tr>
274274
<tr class="markdownTableRowOdd">
275-
<td class="markdownTableBodyNone">100,000 </td><td class="markdownTableBodyNone">77.019 </td><td class="markdownTableBodyNone">46.892 </td><td class="markdownTableBodyNone">365.9 </td></tr>
275+
<td class="markdownTableBodyNone">100,000 </td><td class="markdownTableBodyNone">83.5547 </td><td class="markdownTableBodyNone">49.4451 </td><td class="markdownTableBodyNone">76.5453 </td></tr>
276276
<tr class="markdownTableRowEven">
277-
<td class="markdownTableBodyNone">1,000,000 </td><td class="markdownTableBodyNone">739.4 </td><td class="markdownTableBodyNone">662.998 </td><td class="markdownTableBodyNone">21,592.2 </td></tr>
277+
<td class="markdownTableBodyNone">1,000,000 </td><td class="markdownTableBodyNone">764.227 </td><td class="markdownTableBodyNone">665.519 </td><td class="markdownTableBodyNone">933.844 </td></tr>
278278
</table>
279279
<h2><a class="anchor" id="autotoc_md12"></a>
280-
Best case insert</h2>
281-
<p>The “best case” is inserting random numbers on both the left and right. Results in milliseconds.</p>
282-
<table class="markdownTable">
283-
<tr class="markdownTableHead">
284-
<th class="markdownTableHeadNone"></th><th class="markdownTableHeadNone">one-to-one </th><th class="markdownTableHeadNone">one-to-many </th><th class="markdownTableHeadNone">many-to-many </th></tr>
285-
<tr class="markdownTableRowOdd">
286-
<td class="markdownTableBodyNone">10 </td><td class="markdownTableBodyNone">0.005542 </td><td class="markdownTableBodyNone">0.005625 </td><td class="markdownTableBodyNone">0.00575 </td></tr>
287-
<tr class="markdownTableRowEven">
288-
<td class="markdownTableBodyNone">100 </td><td class="markdownTableBodyNone">0.03325 </td><td class="markdownTableBodyNone">0.042167 </td><td class="markdownTableBodyNone">0.039875 </td></tr>
289-
<tr class="markdownTableRowOdd">
290-
<td class="markdownTableBodyNone">1,000 </td><td class="markdownTableBodyNone">0.25875 </td><td class="markdownTableBodyNone">0.306125 </td><td class="markdownTableBodyNone">0.354167 </td></tr>
291-
<tr class="markdownTableRowEven">
292-
<td class="markdownTableBodyNone">10,000 </td><td class="markdownTableBodyNone">2.37317 </td><td class="markdownTableBodyNone">2.64029 </td><td class="markdownTableBodyNone">3.25633 </td></tr>
293-
<tr class="markdownTableRowOdd">
294-
<td class="markdownTableBodyNone">100,000 </td><td class="markdownTableBodyNone">20.2791 </td><td class="markdownTableBodyNone">18.3426 </td><td class="markdownTableBodyNone">30.7384 </td></tr>
295-
<tr class="markdownTableRowEven">
296-
<td class="markdownTableBodyNone">1,000,000 </td><td class="markdownTableBodyNone">454.936 </td><td class="markdownTableBodyNone">601.014 </td><td class="markdownTableBodyNone">780.828 </td></tr>
297-
</table>
298-
<h2><a class="anchor" id="autotoc_md13"></a>
299280
Lookup</h2>
300281
<p>This is the time it takes for a single lookup in tables of different sizes. Results microseconds.</p>
301282
<table class="markdownTable">
@@ -314,10 +295,10 @@ <h2><a class="anchor" id="autotoc_md13"></a>
314295
<tr class="markdownTableRowEven">
315296
<td class="markdownTableBodyNone">1,000,000 </td><td class="markdownTableBodyNone">0.0652959 </td><td class="markdownTableBodyNone">0.0715042 </td><td class="markdownTableBodyNone">0.0902375 </td></tr>
316297
</table>
317-
<h2><a class="anchor" id="autotoc_md14"></a>
298+
<h2><a class="anchor" id="autotoc_md13"></a>
318299
Thoughts on performance</h2>
319300
<p><code>std::unordered_map</code> is not the fastest hash map. I’m aware of faster ones, but all those I have found have a license that is more restrictive than the MIT license.</p>
320-
<h1><a class="anchor" id="autotoc_md15"></a>
301+
<h1><a class="anchor" id="autotoc_md14"></a>
321302
How it works</h1>
322303
<p>This section is for those who want to venture into the code.</p>
323304
<p>I will show you, and talk you through the structure of the <code>OneToMany</code> template class. The <code>OneToOne</code> and <code>ManyToMany</code> template classes are structured along the same lines.</p>

docs/index.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,9 @@ var index =
1111
[ "Naming of template specializations", "index.html#autotoc_md8", null ],
1212
[ "Efficiency", "index.html#autotoc_md9", null ],
1313
[ "Performance", "index.html#autotoc_md10", [
14-
[ "Worst case insert", "index.html#autotoc_md11", null ],
15-
[ "Best case insert", "index.html#autotoc_md12", null ],
16-
[ "Lookup", "index.html#autotoc_md13", null ],
17-
[ "Thoughts on performance", "index.html#autotoc_md14", null ]
14+
[ "Insert", "index.html#autotoc_md11", null ],
15+
[ "Lookup", "index.html#autotoc_md12", null ],
16+
[ "Thoughts on performance", "index.html#autotoc_md13", null ]
1817
] ],
19-
[ "How it works", "index.html#autotoc_md15", null ]
18+
[ "How it works", "index.html#autotoc_md14", null ]
2019
];

docs/navtreeindex0.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,7 @@ var NAVTREEINDEX0 =
9494
"index.html#autotoc_md11":[0,10,0],
9595
"index.html#autotoc_md12":[0,10,1],
9696
"index.html#autotoc_md13":[0,10,2],
97-
"index.html#autotoc_md14":[0,10,3],
98-
"index.html#autotoc_md15":[0,11],
97+
"index.html#autotoc_md14":[0,11],
9998
"index.html#autotoc_md2":[0,2],
10099
"index.html#autotoc_md3":[0,3],
101100
"index.html#autotoc_md4":[0,4],

docs/search/all_1.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
var searchData=
22
[
33
['begin_0',['begin',['../class_binary_relations_1_1_one_to_many.html#a41efacdf1796ef9bfc06fa1d27adba7e',1,'BinaryRelations::OneToMany::begin()'],['../class_binary_relations_1_1_many_to_many.html#a73d51aef2f025f86a22d4ab18545cf43',1,'BinaryRelations::ManyToMany::begin()'],['../class_binary_relations_1_1_one_to_one.html#ac311b9fdd7574769d16dbd9751a77150',1,'BinaryRelations::OneToOne::begin()']]],
4-
['best_20case_20insert_1',['Best case insert',['../index.html#autotoc_md12',1,'']]],
5-
['binary_20relations_20are_20everywhere_2',['Binary relations are everywhere',['../index.html',1,'Binary relations are everywhere'],['../index.html#autotoc_md4',1,'Binary relations are everywhere']]]
4+
['binary_20relations_20are_20everywhere_1',['Binary relations are everywhere',['../index.html',1,'Binary relations are everywhere'],['../index.html#autotoc_md4',1,'Binary relations are everywhere']]]
65
];

docs/search/all_11.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
var searchData=
22
[
33
['what_20is_20this_0',['What is this?',['../index.html#autotoc_md0',1,'']]],
4-
['works_1',['How it works',['../index.html#autotoc_md15',1,'']]],
5-
['world_20examples_2',['Real world examples',['../index.html#autotoc_md3',1,'']]],
6-
['worst_20case_20insert_3',['Worst case insert',['../index.html#autotoc_md11',1,'']]]
4+
['works_1',['How it works',['../index.html#autotoc_md14',1,'']]],
5+
['world_20examples_2',['Real world examples',['../index.html#autotoc_md3',1,'']]]
76
];

docs/search/all_2.js

Lines changed: 8 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/search/all_5.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
var searchData=
22
[
3-
['how_20it_20works_0',['How it works',['../index.html#autotoc_md15',1,'']]]
3+
['how_20it_20works_0',['How it works',['../index.html#autotoc_md14',1,'']]]
44
];

0 commit comments

Comments
 (0)