File tree Expand file tree Collapse file tree 26 files changed +92
-0
lines changed
benchmarks-mpp/src/jvmMain/kotlin/benchmarks Expand file tree Collapse file tree 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
*/
You can’t perform that action at this time.
0 commit comments