Skip to content

Commit 0704fb8

Browse files
author
Abduqodiri Qurbonzoda
committed
Add info about benchmark measurements
1 parent 9d17362 commit 0704fb8

File tree

26 files changed

+92
-0
lines changed

26 files changed

+92
-0
lines changed

benchmarks-mpp/src/jvmMain/kotlin/benchmarks/immutableList/Add.kt

+6
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ open class Add {
2929
/**
3030
* Adds [size] elements to an empty persistent list.
3131
*
32+
* Measures mean time and memory spent per `add` operation.
33+
*
3234
* Expected time: nearly constant.
3335
* Expected memory: for size in 1..32 - O(size), nearly constant otherwise.
3436
*/
@@ -40,6 +42,8 @@ open class Add {
4042
/**
4143
* Adds [size] elements to an empty persistent list and then iterates all elements from first to last.
4244
*
45+
* Measures mean time and memory spent per `add` and `next` operations.
46+
*
4347
* Expected time: [addLast] + [Iterate.firstToLast]
4448
* Expected memory: [addLast] + [Iterate.firstToLast]
4549
*/
@@ -54,6 +58,8 @@ open class Add {
5458
/**
5559
* Adds [size] elements to an empty persistent list and then gets all elements by index from first to last.
5660
*
61+
* Measures mean time and memory spent per `add` and `get` operations.
62+
*
5763
* Expected time: [addLast] + [Get.getByIndex]
5864
* Expected memory: [addLast] + [Get.getByIndex]
5965
*/

benchmarks-mpp/src/jvmMain/kotlin/benchmarks/immutableList/Get.kt

+2
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ open class Get {
3737
/**
3838
* Gets every element by index starting from first to last.
3939
*
40+
* Measures mean time and memory spent per `get` operation.
41+
*
4042
* Expected time: logarithmic
4143
* Expected memory: none
4244
*/

benchmarks-mpp/src/jvmMain/kotlin/benchmarks/immutableList/Iterate.kt

+4
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ open class Iterate {
3737
/**
3838
* Iterates every element starting from first to last.
3939
*
40+
* Measures mean time and memory spent per `next` operation.
41+
*
4042
* Expected time: nearly constant
4143
* Expected memory: none once iterator created
4244
*/
@@ -50,6 +52,8 @@ open class Iterate {
5052
/**
5153
* Iterates every element starting from last to first.
5254
*
55+
* Measures mean time and memory spent per `previous` operation.
56+
*
5357
* Expected time: nearly constant
5458
* Expected memory: none once iterator created
5559
*/

benchmarks-mpp/src/jvmMain/kotlin/benchmarks/immutableList/Remove.kt

+2
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ open class Remove {
3737
/**
3838
* Removes all elements by index starting from last to first.
3939
*
40+
* Measures mean time and memory spent per `removeAt` operation.
41+
*
4042
* Expected time: nearly constant.
4143
* Expected memory: for size in 1..32 - O(size), nearly constant otherwise.
4244
*/

benchmarks-mpp/src/jvmMain/kotlin/benchmarks/immutableList/Set.kt

+4
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ open class Set {
3939
/**
4040
* Updates each element by index starting from first to last.
4141
*
42+
* Measures mean time and memory spent per `set` operation.
43+
*
4244
* Expected time: logarithmic
4345
* Expected memory: logarithmic
4446
*/
@@ -53,6 +55,8 @@ open class Set {
5355
/**
5456
* Updates each element by index randomly.
5557
*
58+
* Measures mean time and memory spent per `set` operation.
59+
*
5660
* Expected time: logarithmic
5761
* Expected memory: logarithmic
5862
*/

benchmarks-mpp/src/jvmMain/kotlin/benchmarks/immutableList/builder/Add.kt

+6
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ open class Add {
3232
/**
3333
* Adds [size] elements to an empty persistent list builder.
3434
*
35+
* Measures mean time and memory spent per `add` operation.
36+
*
3537
* Expected time: nearly constant.
3638
* Expected memory: nearly constant.
3739
*/
@@ -43,6 +45,8 @@ open class Add {
4345
/**
4446
* Adds [size] elements to an empty persistent list builder and then iterates all elements from first to last.
4547
*
48+
* Measures mean time and memory spent per `add` and `next` operations.
49+
*
4650
* Expected time: [addLast] + [Iterate.firstToLast]
4751
* Expected memory: [addLast] + [Iterate.firstToLast]
4852
*/
@@ -57,6 +61,8 @@ open class Add {
5761
/**
5862
* Adds [size] elements to an empty persistent list builder and then gets all elements by index from first to last.
5963
*
64+
* Measures mean time and memory spent per `add` and `get` operations.
65+
*
6066
* Expected time: [addLast] + [Get.getByIndex]
6167
* Expected memory: [addLast] + [Get.getByIndex]
6268
*/

benchmarks-mpp/src/jvmMain/kotlin/benchmarks/immutableList/builder/Get.kt

+2
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ open class Get {
3939
/**
4040
* Gets every element by index starting from first to last.
4141
*
42+
* Measures mean time and memory spent per `get` operation.
43+
*
4244
* Expected time: logarithmic
4345
* Expected memory: none
4446
*/

benchmarks-mpp/src/jvmMain/kotlin/benchmarks/immutableList/builder/Iterate.kt

+4
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ open class Iterate {
3939
/**
4040
* Iterates every element starting from first to last.
4141
*
42+
* Measures mean time and memory spent per `next` operation.
43+
*
4244
* Expected time: nearly constant
4345
* Expected memory: none once iterator created
4446
*/
@@ -52,6 +54,8 @@ open class Iterate {
5254
/**
5355
* Iterates every element starting from last to first.
5456
*
57+
* Measures mean time and memory spent per `previous` operation.
58+
*
5559
* Expected time: nearly constant
5660
* Expected memory: none once iterator created
5761
*/

benchmarks-mpp/src/jvmMain/kotlin/benchmarks/immutableList/builder/Remove.kt

+2
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ open class Remove {
3131
/**
3232
* Adds [size] elements to an empty persistent list builder and then removes each element by index starting from last to first.
3333
*
34+
* Measures mean time and memory spent per `add` and `removeAt` operations.
35+
*
3436
* Expected time: [Add.addLast] + nearly constant.
3537
* Expected memory: [Add.addLast] + nearly constant.
3638
*/

benchmarks-mpp/src/jvmMain/kotlin/benchmarks/immutableList/builder/Set.kt

+4
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ open class Set {
4141
/**
4242
* Updates each element by index starting from first to last.
4343
*
44+
* Measures mean time and memory spent per `set` operation.
45+
*
4446
* Expected time: logarithmic
4547
* Expected memory: nearly constant
4648
*/
@@ -55,6 +57,8 @@ open class Set {
5557
/**
5658
* Updates each element by index randomly.
5759
*
60+
* Measures mean time and memory spent per `set` operation.
61+
*
5862
* Expected time: logarithmic
5963
* Expected memory: nearly constant
6064
*/

benchmarks-mpp/src/jvmMain/kotlin/benchmarks/immutableMap/Get.kt

+2
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ open class Get {
4747
/**
4848
* Gets every value by key.
4949
*
50+
* Measures mean time and memory spent per `get` operation.
51+
*
5052
* Expected time: logarithmic
5153
* Expected memory: none
5254
*/

benchmarks-mpp/src/jvmMain/kotlin/benchmarks/immutableMap/Iterate.kt

+6
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ open class Iterate {
4242
/**
4343
* Iterates all keys.
4444
*
45+
* Measures mean time and memory spent per `next` operation.
46+
*
4547
* Expected time: nearly constant (logarithmic for ordered persistent map)
4648
* Expected memory: none once iterator is created.
4749
*/
@@ -55,6 +57,8 @@ open class Iterate {
5557
/**
5658
* Iterates all values.
5759
*
60+
* Measures mean time and memory spent per `next` operation.
61+
*
5862
* Expected time: nearly constant (logarithmic for ordered persistent map)
5963
* Expected memory: none once iterator is created.
6064
*/
@@ -68,6 +72,8 @@ open class Iterate {
6872
/**
6973
* Iterates all entries.
7074
*
75+
* Measures mean time and memory spent per `next` operation.
76+
*
7177
* Expected time: nearly constant (logarithmic for ordered persistent map)
7278
* Expected memory: constant.
7379
*/

benchmarks-mpp/src/jvmMain/kotlin/benchmarks/immutableMap/Put.kt

+6
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ open class Put {
4242
/**
4343
* Adds [size] entries to an empty persistent map.
4444
*
45+
* Measures mean time and memory spent per `put` operation.
46+
*
4547
* Expected time: logarithmic
4648
* Expected memory: logarithmic
4749
*/
@@ -53,6 +55,8 @@ open class Put {
5355
/**
5456
* Adds [size] entries to an empty persistent map and then gets every value by key.
5557
*
58+
* Measures mean time and memory spent per `put` and `get` operations.
59+
*
5660
* Expected time: [put] + [Get.get]
5761
* Expected memory: [put] + [Get.get]
5862
*/
@@ -67,6 +71,8 @@ open class Put {
6771
/**
6872
* Adds [size] entries to an empty persistent map and then iterates all keys.
6973
*
74+
* Measures mean time and memory spent per `put` and `next` operations.
75+
*
7076
* Expected time: [put] + [Iterate.iterateKeys]
7177
* Expected memory: [put] + [Iterate.iterateKeys]
7278
*/

benchmarks-mpp/src/jvmMain/kotlin/benchmarks/immutableMap/Remove.kt

+2
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ open class Remove {
4747
/**
4848
* Removes each entry by key.
4949
*
50+
* Measures mean time and memory spent per `remove` operation.
51+
*
5052
* Expected time: logarithmic
5153
* Expected memory: logarithmic
5254
*/

benchmarks-mpp/src/jvmMain/kotlin/benchmarks/immutableMap/builder/Get.kt

+2
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ open class Get {
5050
/**
5151
* Gets every value by key.
5252
*
53+
* Measures mean time and memory spent per `get` operation.
54+
*
5355
* Expected time: logarithmic
5456
* Expected memory: none
5557
*/

benchmarks-mpp/src/jvmMain/kotlin/benchmarks/immutableMap/builder/Iterate.kt

+6
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ open class Iterate {
4646
/**
4747
* Iterates all keys.
4848
*
49+
* Measures mean time and memory spent per `next` operation.
50+
*
4951
* Expected time: nearly constant (logarithmic for ordered persistent map)
5052
* Expected memory: none once iterator is created.
5153
*/
@@ -59,6 +61,8 @@ open class Iterate {
5961
/**
6062
* Iterates all values.
6163
*
64+
* Measures mean time and memory spent per `next` operation.
65+
*
6266
* Expected time: nearly constant (logarithmic for ordered persistent map)
6367
* Expected memory: constant.
6468
*/
@@ -72,6 +76,8 @@ open class Iterate {
7276
/**
7377
* Iterates all entries.
7478
*
79+
* Measures mean time and memory spent per `next` operation.
80+
*
7581
* Expected time: nearly constant (logarithmic for ordered persistent map)
7682
* Expected memory: constant.
7783
*/

benchmarks-mpp/src/jvmMain/kotlin/benchmarks/immutableMap/builder/Put.kt

+6
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ open class Put {
4545
/**
4646
* Adds [size] entries to an empty persistent map builder.
4747
*
48+
* Measures mean time and memory spent per `put` operation.
49+
*
4850
* Expected time: logarithmic
4951
* Expected memory: logarithmic
5052
*/
@@ -56,6 +58,8 @@ open class Put {
5658
/**
5759
* Adds [size] entries to an empty persistent map builder and then gets every value by key.
5860
*
61+
* Measures mean time and memory spent per `put` and `get` operations.
62+
*
5963
* Expected time: [put] + [Get.get]
6064
* Expected memory: [put] + [Get.get]
6165
*/
@@ -70,6 +74,8 @@ open class Put {
7074
/**
7175
* Adds [size] entries to an empty persistent map builder and then iterates all keys.
7276
*
77+
* Measures mean time and memory spent per `put` and `next` operations.
78+
*
7379
* Expected time: [put] + [Iterate.iterateKeys]
7480
* Expected memory: [put] + [Iterate.iterateKeys]
7581
*/

benchmarks-mpp/src/jvmMain/kotlin/benchmarks/immutableMap/builder/Remove.kt

+2
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ open class Remove {
5151
/**
5252
* Adds [size] entries to an empty persistent map builder and then removes each entry by key.
5353
*
54+
* Measures mean time and memory spent per `put` and `remove` operations.
55+
*
5456
* Expected time: [Put.put] + logarithmic
5557
* Expected memory: [Put.put] + logarithmic
5658
*/

benchmarks-mpp/src/jvmMain/kotlin/benchmarks/immutableSet/Add.kt

+6
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ open class Add {
4242
/**
4343
* Adds [size] elements to an empty persistent set.
4444
*
45+
* Measures mean time and memory spent per `add` operation.
46+
*
4547
* Expected time: logarithmic
4648
* Expected memory: logarithmic
4749
*/
@@ -53,6 +55,8 @@ open class Add {
5355
/**
5456
* Adds [size] elements to an empty persistent set and then requests if every element is contained.
5557
*
58+
* Measures mean time and memory spent per `add` and `contains` operations.
59+
*
5660
* Expected time: [add] + [Contains.contains]
5761
* Expected memory: [add] + [Contains.contains]
5862
*/
@@ -67,6 +71,8 @@ open class Add {
6771
/**
6872
* Adds [size] elements to an empty persistent set and then iterates all elements.
6973
*
74+
* Measures mean time and memory spent per `add` and `next` operations.
75+
*
7076
* Expected time: [add] + [Iterate.iterate]
7177
* Expected memory: [add] + [Iterate.iterate]
7278
*/

benchmarks-mpp/src/jvmMain/kotlin/benchmarks/immutableSet/Contains.kt

+2
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ open class Contains {
4747
/**
4848
* Requests if every element is contained.
4949
*
50+
* Measures mean time and memory spent per `contains` operation.
51+
*
5052
* Expected time: logarithmic
5153
* Expected memory: none
5254
*/

benchmarks-mpp/src/jvmMain/kotlin/benchmarks/immutableSet/Iterate.kt

+2
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ open class Iterate {
4242
/**
4343
* Iterates all elements.
4444
*
45+
* Measures mean time and memory spent per `next` operation.
46+
*
4547
* Expected time: nearly constant (logarithmic for ordered persistent map)
4648
* Expected memory: none once iterator is created.
4749
*/

benchmarks-mpp/src/jvmMain/kotlin/benchmarks/immutableSet/Remove.kt

+2
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ open class Remove {
4747
/**
4848
* Removes each element.
4949
*
50+
* Measures mean time and memory spent per `remove` operation.
51+
*
5052
* Expected time: logarithmic
5153
* Expected memory: logarithmic
5254
*/

benchmarks-mpp/src/jvmMain/kotlin/benchmarks/immutableSet/builder/Add.kt

+6
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ open class Add {
4545
/**
4646
* Adds [size] elements to an empty persistent set builder.
4747
*
48+
* Measures mean time and memory spent per `add` operation.
49+
*
4850
* Expected time: logarithmic
4951
* Expected memory: logarithmic
5052
*/
@@ -56,6 +58,8 @@ open class Add {
5658
/**
5759
* Adds [size] elements to an empty persistent set builder and then requests if every element is contained.
5860
*
61+
* Measures mean time and memory spent per `add` and `contains` operations.
62+
*
5963
* Expected time: [add] + [Contains.contains]
6064
* Expected memory: [add] + [Contains.contains]
6165
*/
@@ -70,6 +74,8 @@ open class Add {
7074
/**
7175
* Adds [size] elements to an empty persistent set builder and then iterates all elements.
7276
*
77+
* Measures mean time and memory spent per `add` and `next` operations.
78+
*
7379
* Expected time: [add] + [Iterate.iterate]
7480
* Expected memory: [add] + [Iterate.iterate]
7581
*/

benchmarks-mpp/src/jvmMain/kotlin/benchmarks/immutableSet/builder/Contains.kt

+2
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ open class Contains {
5050
/**
5151
* Requests if every element is contained.
5252
*
53+
* Measures mean time and memory spent per `contains` operation.
54+
*
5355
* Expected time: logarithmic
5456
* Expected memory: none
5557
*/

0 commit comments

Comments
 (0)