File tree 26 files changed +92
-0
lines changed
benchmarks-mpp/src/jvmMain/kotlin/benchmarks
26 files changed +92
-0
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,8 @@ open class Add {
29
29
/* *
30
30
* Adds [size] elements to an empty persistent list.
31
31
*
32
+ * Measures mean time and memory spent per `add` operation.
33
+ *
32
34
* Expected time: nearly constant.
33
35
* Expected memory: for size in 1..32 - O(size), nearly constant otherwise.
34
36
*/
@@ -40,6 +42,8 @@ open class Add {
40
42
/* *
41
43
* Adds [size] elements to an empty persistent list and then iterates all elements from first to last.
42
44
*
45
+ * Measures mean time and memory spent per `add` and `next` operations.
46
+ *
43
47
* Expected time: [addLast] + [Iterate.firstToLast]
44
48
* Expected memory: [addLast] + [Iterate.firstToLast]
45
49
*/
@@ -54,6 +58,8 @@ open class Add {
54
58
/* *
55
59
* Adds [size] elements to an empty persistent list and then gets all elements by index from first to last.
56
60
*
61
+ * Measures mean time and memory spent per `add` and `get` operations.
62
+ *
57
63
* Expected time: [addLast] + [Get.getByIndex]
58
64
* Expected memory: [addLast] + [Get.getByIndex]
59
65
*/
Original file line number Diff line number Diff line change @@ -37,6 +37,8 @@ open class Get {
37
37
/* *
38
38
* Gets every element by index starting from first to last.
39
39
*
40
+ * Measures mean time and memory spent per `get` operation.
41
+ *
40
42
* Expected time: logarithmic
41
43
* Expected memory: none
42
44
*/
Original file line number Diff line number Diff line change @@ -37,6 +37,8 @@ open class Iterate {
37
37
/* *
38
38
* Iterates every element starting from first to last.
39
39
*
40
+ * Measures mean time and memory spent per `next` operation.
41
+ *
40
42
* Expected time: nearly constant
41
43
* Expected memory: none once iterator created
42
44
*/
@@ -50,6 +52,8 @@ open class Iterate {
50
52
/* *
51
53
* Iterates every element starting from last to first.
52
54
*
55
+ * Measures mean time and memory spent per `previous` operation.
56
+ *
53
57
* Expected time: nearly constant
54
58
* Expected memory: none once iterator created
55
59
*/
Original file line number Diff line number Diff line change @@ -37,6 +37,8 @@ open class Remove {
37
37
/* *
38
38
* Removes all elements by index starting from last to first.
39
39
*
40
+ * Measures mean time and memory spent per `removeAt` operation.
41
+ *
40
42
* Expected time: nearly constant.
41
43
* Expected memory: for size in 1..32 - O(size), nearly constant otherwise.
42
44
*/
Original file line number Diff line number Diff line change @@ -39,6 +39,8 @@ open class Set {
39
39
/* *
40
40
* Updates each element by index starting from first to last.
41
41
*
42
+ * Measures mean time and memory spent per `set` operation.
43
+ *
42
44
* Expected time: logarithmic
43
45
* Expected memory: logarithmic
44
46
*/
@@ -53,6 +55,8 @@ open class Set {
53
55
/* *
54
56
* Updates each element by index randomly.
55
57
*
58
+ * Measures mean time and memory spent per `set` operation.
59
+ *
56
60
* Expected time: logarithmic
57
61
* Expected memory: logarithmic
58
62
*/
Original file line number Diff line number Diff line change @@ -32,6 +32,8 @@ open class Add {
32
32
/* *
33
33
* Adds [size] elements to an empty persistent list builder.
34
34
*
35
+ * Measures mean time and memory spent per `add` operation.
36
+ *
35
37
* Expected time: nearly constant.
36
38
* Expected memory: nearly constant.
37
39
*/
@@ -43,6 +45,8 @@ open class Add {
43
45
/* *
44
46
* Adds [size] elements to an empty persistent list builder and then iterates all elements from first to last.
45
47
*
48
+ * Measures mean time and memory spent per `add` and `next` operations.
49
+ *
46
50
* Expected time: [addLast] + [Iterate.firstToLast]
47
51
* Expected memory: [addLast] + [Iterate.firstToLast]
48
52
*/
@@ -57,6 +61,8 @@ open class Add {
57
61
/* *
58
62
* Adds [size] elements to an empty persistent list builder and then gets all elements by index from first to last.
59
63
*
64
+ * Measures mean time and memory spent per `add` and `get` operations.
65
+ *
60
66
* Expected time: [addLast] + [Get.getByIndex]
61
67
* Expected memory: [addLast] + [Get.getByIndex]
62
68
*/
Original file line number Diff line number Diff line change @@ -39,6 +39,8 @@ open class Get {
39
39
/* *
40
40
* Gets every element by index starting from first to last.
41
41
*
42
+ * Measures mean time and memory spent per `get` operation.
43
+ *
42
44
* Expected time: logarithmic
43
45
* Expected memory: none
44
46
*/
Original file line number Diff line number Diff line change @@ -39,6 +39,8 @@ open class Iterate {
39
39
/* *
40
40
* Iterates every element starting from first to last.
41
41
*
42
+ * Measures mean time and memory spent per `next` operation.
43
+ *
42
44
* Expected time: nearly constant
43
45
* Expected memory: none once iterator created
44
46
*/
@@ -52,6 +54,8 @@ open class Iterate {
52
54
/* *
53
55
* Iterates every element starting from last to first.
54
56
*
57
+ * Measures mean time and memory spent per `previous` operation.
58
+ *
55
59
* Expected time: nearly constant
56
60
* Expected memory: none once iterator created
57
61
*/
Original file line number Diff line number Diff line change @@ -31,6 +31,8 @@ open class Remove {
31
31
/* *
32
32
* Adds [size] elements to an empty persistent list builder and then removes each element by index starting from last to first.
33
33
*
34
+ * Measures mean time and memory spent per `add` and `removeAt` operations.
35
+ *
34
36
* Expected time: [Add.addLast] + nearly constant.
35
37
* Expected memory: [Add.addLast] + nearly constant.
36
38
*/
Original file line number Diff line number Diff line change @@ -41,6 +41,8 @@ open class Set {
41
41
/* *
42
42
* Updates each element by index starting from first to last.
43
43
*
44
+ * Measures mean time and memory spent per `set` operation.
45
+ *
44
46
* Expected time: logarithmic
45
47
* Expected memory: nearly constant
46
48
*/
@@ -55,6 +57,8 @@ open class Set {
55
57
/* *
56
58
* Updates each element by index randomly.
57
59
*
60
+ * Measures mean time and memory spent per `set` operation.
61
+ *
58
62
* Expected time: logarithmic
59
63
* Expected memory: nearly constant
60
64
*/
Original file line number Diff line number Diff line change @@ -47,6 +47,8 @@ open class Get {
47
47
/* *
48
48
* Gets every value by key.
49
49
*
50
+ * Measures mean time and memory spent per `get` operation.
51
+ *
50
52
* Expected time: logarithmic
51
53
* Expected memory: none
52
54
*/
Original file line number Diff line number Diff line change @@ -42,6 +42,8 @@ open class Iterate {
42
42
/* *
43
43
* Iterates all keys.
44
44
*
45
+ * Measures mean time and memory spent per `next` operation.
46
+ *
45
47
* Expected time: nearly constant (logarithmic for ordered persistent map)
46
48
* Expected memory: none once iterator is created.
47
49
*/
@@ -55,6 +57,8 @@ open class Iterate {
55
57
/* *
56
58
* Iterates all values.
57
59
*
60
+ * Measures mean time and memory spent per `next` operation.
61
+ *
58
62
* Expected time: nearly constant (logarithmic for ordered persistent map)
59
63
* Expected memory: none once iterator is created.
60
64
*/
@@ -68,6 +72,8 @@ open class Iterate {
68
72
/* *
69
73
* Iterates all entries.
70
74
*
75
+ * Measures mean time and memory spent per `next` operation.
76
+ *
71
77
* Expected time: nearly constant (logarithmic for ordered persistent map)
72
78
* Expected memory: constant.
73
79
*/
Original file line number Diff line number Diff line change @@ -42,6 +42,8 @@ open class Put {
42
42
/* *
43
43
* Adds [size] entries to an empty persistent map.
44
44
*
45
+ * Measures mean time and memory spent per `put` operation.
46
+ *
45
47
* Expected time: logarithmic
46
48
* Expected memory: logarithmic
47
49
*/
@@ -53,6 +55,8 @@ open class Put {
53
55
/* *
54
56
* Adds [size] entries to an empty persistent map and then gets every value by key.
55
57
*
58
+ * Measures mean time and memory spent per `put` and `get` operations.
59
+ *
56
60
* Expected time: [put] + [Get.get]
57
61
* Expected memory: [put] + [Get.get]
58
62
*/
@@ -67,6 +71,8 @@ open class Put {
67
71
/* *
68
72
* Adds [size] entries to an empty persistent map and then iterates all keys.
69
73
*
74
+ * Measures mean time and memory spent per `put` and `next` operations.
75
+ *
70
76
* Expected time: [put] + [Iterate.iterateKeys]
71
77
* Expected memory: [put] + [Iterate.iterateKeys]
72
78
*/
Original file line number Diff line number Diff line change @@ -47,6 +47,8 @@ open class Remove {
47
47
/* *
48
48
* Removes each entry by key.
49
49
*
50
+ * Measures mean time and memory spent per `remove` operation.
51
+ *
50
52
* Expected time: logarithmic
51
53
* Expected memory: logarithmic
52
54
*/
Original file line number Diff line number Diff line change @@ -50,6 +50,8 @@ open class Get {
50
50
/* *
51
51
* Gets every value by key.
52
52
*
53
+ * Measures mean time and memory spent per `get` operation.
54
+ *
53
55
* Expected time: logarithmic
54
56
* Expected memory: none
55
57
*/
Original file line number Diff line number Diff line change @@ -46,6 +46,8 @@ open class Iterate {
46
46
/* *
47
47
* Iterates all keys.
48
48
*
49
+ * Measures mean time and memory spent per `next` operation.
50
+ *
49
51
* Expected time: nearly constant (logarithmic for ordered persistent map)
50
52
* Expected memory: none once iterator is created.
51
53
*/
@@ -59,6 +61,8 @@ open class Iterate {
59
61
/* *
60
62
* Iterates all values.
61
63
*
64
+ * Measures mean time and memory spent per `next` operation.
65
+ *
62
66
* Expected time: nearly constant (logarithmic for ordered persistent map)
63
67
* Expected memory: constant.
64
68
*/
@@ -72,6 +76,8 @@ open class Iterate {
72
76
/* *
73
77
* Iterates all entries.
74
78
*
79
+ * Measures mean time and memory spent per `next` operation.
80
+ *
75
81
* Expected time: nearly constant (logarithmic for ordered persistent map)
76
82
* Expected memory: constant.
77
83
*/
Original file line number Diff line number Diff line change @@ -45,6 +45,8 @@ open class Put {
45
45
/* *
46
46
* Adds [size] entries to an empty persistent map builder.
47
47
*
48
+ * Measures mean time and memory spent per `put` operation.
49
+ *
48
50
* Expected time: logarithmic
49
51
* Expected memory: logarithmic
50
52
*/
@@ -56,6 +58,8 @@ open class Put {
56
58
/* *
57
59
* Adds [size] entries to an empty persistent map builder and then gets every value by key.
58
60
*
61
+ * Measures mean time and memory spent per `put` and `get` operations.
62
+ *
59
63
* Expected time: [put] + [Get.get]
60
64
* Expected memory: [put] + [Get.get]
61
65
*/
@@ -70,6 +74,8 @@ open class Put {
70
74
/* *
71
75
* Adds [size] entries to an empty persistent map builder and then iterates all keys.
72
76
*
77
+ * Measures mean time and memory spent per `put` and `next` operations.
78
+ *
73
79
* Expected time: [put] + [Iterate.iterateKeys]
74
80
* Expected memory: [put] + [Iterate.iterateKeys]
75
81
*/
Original file line number Diff line number Diff line change @@ -51,6 +51,8 @@ open class Remove {
51
51
/* *
52
52
* Adds [size] entries to an empty persistent map builder and then removes each entry by key.
53
53
*
54
+ * Measures mean time and memory spent per `put` and `remove` operations.
55
+ *
54
56
* Expected time: [Put.put] + logarithmic
55
57
* Expected memory: [Put.put] + logarithmic
56
58
*/
Original file line number Diff line number Diff line change @@ -42,6 +42,8 @@ open class Add {
42
42
/* *
43
43
* Adds [size] elements to an empty persistent set.
44
44
*
45
+ * Measures mean time and memory spent per `add` operation.
46
+ *
45
47
* Expected time: logarithmic
46
48
* Expected memory: logarithmic
47
49
*/
@@ -53,6 +55,8 @@ open class Add {
53
55
/* *
54
56
* Adds [size] elements to an empty persistent set and then requests if every element is contained.
55
57
*
58
+ * Measures mean time and memory spent per `add` and `contains` operations.
59
+ *
56
60
* Expected time: [add] + [Contains.contains]
57
61
* Expected memory: [add] + [Contains.contains]
58
62
*/
@@ -67,6 +71,8 @@ open class Add {
67
71
/* *
68
72
* Adds [size] elements to an empty persistent set and then iterates all elements.
69
73
*
74
+ * Measures mean time and memory spent per `add` and `next` operations.
75
+ *
70
76
* Expected time: [add] + [Iterate.iterate]
71
77
* Expected memory: [add] + [Iterate.iterate]
72
78
*/
Original file line number Diff line number Diff line change @@ -47,6 +47,8 @@ open class Contains {
47
47
/* *
48
48
* Requests if every element is contained.
49
49
*
50
+ * Measures mean time and memory spent per `contains` operation.
51
+ *
50
52
* Expected time: logarithmic
51
53
* Expected memory: none
52
54
*/
Original file line number Diff line number Diff line change @@ -42,6 +42,8 @@ open class Iterate {
42
42
/* *
43
43
* Iterates all elements.
44
44
*
45
+ * Measures mean time and memory spent per `next` operation.
46
+ *
45
47
* Expected time: nearly constant (logarithmic for ordered persistent map)
46
48
* Expected memory: none once iterator is created.
47
49
*/
Original file line number Diff line number Diff line change @@ -47,6 +47,8 @@ open class Remove {
47
47
/* *
48
48
* Removes each element.
49
49
*
50
+ * Measures mean time and memory spent per `remove` operation.
51
+ *
50
52
* Expected time: logarithmic
51
53
* Expected memory: logarithmic
52
54
*/
Original file line number Diff line number Diff line change @@ -45,6 +45,8 @@ open class Add {
45
45
/* *
46
46
* Adds [size] elements to an empty persistent set builder.
47
47
*
48
+ * Measures mean time and memory spent per `add` operation.
49
+ *
48
50
* Expected time: logarithmic
49
51
* Expected memory: logarithmic
50
52
*/
@@ -56,6 +58,8 @@ open class Add {
56
58
/* *
57
59
* Adds [size] elements to an empty persistent set builder and then requests if every element is contained.
58
60
*
61
+ * Measures mean time and memory spent per `add` and `contains` operations.
62
+ *
59
63
* Expected time: [add] + [Contains.contains]
60
64
* Expected memory: [add] + [Contains.contains]
61
65
*/
@@ -70,6 +74,8 @@ open class Add {
70
74
/* *
71
75
* Adds [size] elements to an empty persistent set builder and then iterates all elements.
72
76
*
77
+ * Measures mean time and memory spent per `add` and `next` operations.
78
+ *
73
79
* Expected time: [add] + [Iterate.iterate]
74
80
* Expected memory: [add] + [Iterate.iterate]
75
81
*/
Original file line number Diff line number Diff line change @@ -50,6 +50,8 @@ open class Contains {
50
50
/* *
51
51
* Requests if every element is contained.
52
52
*
53
+ * Measures mean time and memory spent per `contains` operation.
54
+ *
53
55
* Expected time: logarithmic
54
56
* Expected memory: none
55
57
*/
You can’t perform that action at this time.
0 commit comments