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 {
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     */  
Original file line number Diff line number Diff 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     */  
Original file line number Diff line number Diff 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     */  
Original file line number Diff line number Diff 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     */  
Original file line number Diff line number Diff 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     */  
Original file line number Diff line number Diff 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     */  
Original file line number Diff line number Diff 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     */  
Original file line number Diff line number Diff 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     */  
Original file line number Diff line number Diff 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     */  
Original file line number Diff line number Diff 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     */  
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments