Skip to content

Commit

Permalink
Add info about benchmark measurements
Browse files Browse the repository at this point in the history
  • Loading branch information
Abduqodiri Qurbonzoda committed Aug 6, 2019
1 parent f3aa275 commit 49a182c
Show file tree
Hide file tree
Showing 26 changed files with 92 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ open class Add {
/**
* Adds [size] elements to an empty persistent list.
*
* Measures mean time and memory spent per `add` operation.
*
* Expected time: nearly constant.
* Expected memory: for size in 1..32 - O(size), nearly constant otherwise.
*/
Expand All @@ -40,6 +42,8 @@ open class Add {
/**
* Adds [size] elements to an empty persistent list and then iterates all elements from first to last.
*
* Measures mean time and memory spent per `add` and `next` operations.
*
* Expected time: [addLast] + [Iterate.firstToLast]
* Expected memory: [addLast] + [Iterate.firstToLast]
*/
Expand All @@ -54,6 +58,8 @@ open class Add {
/**
* Adds [size] elements to an empty persistent list and then gets all elements by index from first to last.
*
* Measures mean time and memory spent per `add` and `get` operations.
*
* Expected time: [addLast] + [Get.getByIndex]
* Expected memory: [addLast] + [Get.getByIndex]
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ open class Get {
/**
* Gets every element by index starting from first to last.
*
* Measures mean time and memory spent per `get` operation.
*
* Expected time: logarithmic
* Expected memory: none
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ open class Iterate {
/**
* Iterates every element starting from first to last.
*
* Measures mean time and memory spent per `next` operation.
*
* Expected time: nearly constant
* Expected memory: none once iterator created
*/
Expand All @@ -50,6 +52,8 @@ open class Iterate {
/**
* Iterates every element starting from last to first.
*
* Measures mean time and memory spent per `previous` operation.
*
* Expected time: nearly constant
* Expected memory: none once iterator created
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ open class Remove {
/**
* Removes all elements by index starting from last to first.
*
* Measures mean time and memory spent per `removeAt` operation.
*
* Expected time: nearly constant.
* Expected memory: for size in 1..32 - O(size), nearly constant otherwise.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ open class Set {
/**
* Updates each element by index starting from first to last.
*
* Measures mean time and memory spent per `set` operation.
*
* Expected time: logarithmic
* Expected memory: logarithmic
*/
Expand All @@ -53,6 +55,8 @@ open class Set {
/**
* Updates each element by index randomly.
*
* Measures mean time and memory spent per `set` operation.
*
* Expected time: logarithmic
* Expected memory: logarithmic
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ open class Add {
/**
* Adds [size] elements to an empty persistent list builder.
*
* Measures mean time and memory spent per `add` operation.
*
* Expected time: nearly constant.
* Expected memory: nearly constant.
*/
Expand All @@ -43,6 +45,8 @@ open class Add {
/**
* Adds [size] elements to an empty persistent list builder and then iterates all elements from first to last.
*
* Measures mean time and memory spent per `add` and `next` operations.
*
* Expected time: [addLast] + [Iterate.firstToLast]
* Expected memory: [addLast] + [Iterate.firstToLast]
*/
Expand All @@ -57,6 +61,8 @@ open class Add {
/**
* Adds [size] elements to an empty persistent list builder and then gets all elements by index from first to last.
*
* Measures mean time and memory spent per `add` and `get` operations.
*
* Expected time: [addLast] + [Get.getByIndex]
* Expected memory: [addLast] + [Get.getByIndex]
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ open class Get {
/**
* Gets every element by index starting from first to last.
*
* Measures mean time and memory spent per `get` operation.
*
* Expected time: logarithmic
* Expected memory: none
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ open class Iterate {
/**
* Iterates every element starting from first to last.
*
* Measures mean time and memory spent per `next` operation.
*
* Expected time: nearly constant
* Expected memory: none once iterator created
*/
Expand All @@ -52,6 +54,8 @@ open class Iterate {
/**
* Iterates every element starting from last to first.
*
* Measures mean time and memory spent per `previous` operation.
*
* Expected time: nearly constant
* Expected memory: none once iterator created
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ open class Remove {
/**
* Adds [size] elements to an empty persistent list builder and then removes each element by index starting from last to first.
*
* Measures mean time and memory spent per `add` and `removeAt` operations.
*
* Expected time: [Add.addLast] + nearly constant.
* Expected memory: [Add.addLast] + nearly constant.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ open class Set {
/**
* Updates each element by index starting from first to last.
*
* Measures mean time and memory spent per `set` operation.
*
* Expected time: logarithmic
* Expected memory: nearly constant
*/
Expand All @@ -55,6 +57,8 @@ open class Set {
/**
* Updates each element by index randomly.
*
* Measures mean time and memory spent per `set` operation.
*
* Expected time: logarithmic
* Expected memory: nearly constant
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ open class Get {
/**
* Gets every value by key.
*
* Measures mean time and memory spent per `get` operation.
*
* Expected time: logarithmic
* Expected memory: none
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ open class Iterate {
/**
* Iterates all keys.
*
* Measures mean time and memory spent per `next` operation.
*
* Expected time: nearly constant (logarithmic for ordered persistent map)
* Expected memory: none once iterator is created.
*/
Expand All @@ -55,6 +57,8 @@ open class Iterate {
/**
* Iterates all values.
*
* Measures mean time and memory spent per `next` operation.
*
* Expected time: nearly constant (logarithmic for ordered persistent map)
* Expected memory: none once iterator is created.
*/
Expand All @@ -68,6 +72,8 @@ open class Iterate {
/**
* Iterates all entries.
*
* Measures mean time and memory spent per `next` operation.
*
* Expected time: nearly constant (logarithmic for ordered persistent map)
* Expected memory: constant.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ open class Put {
/**
* Adds [size] entries to an empty persistent map.
*
* Measures mean time and memory spent per `put` operation.
*
* Expected time: logarithmic
* Expected memory: logarithmic
*/
Expand All @@ -53,6 +55,8 @@ open class Put {
/**
* Adds [size] entries to an empty persistent map and then gets every value by key.
*
* Measures mean time and memory spent per `put` and `get` operations.
*
* Expected time: [put] + [Get.get]
* Expected memory: [put] + [Get.get]
*/
Expand All @@ -67,6 +71,8 @@ open class Put {
/**
* Adds [size] entries to an empty persistent map and then iterates all keys.
*
* Measures mean time and memory spent per `put` and `next` operations.
*
* Expected time: [put] + [Iterate.iterateKeys]
* Expected memory: [put] + [Iterate.iterateKeys]
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ open class Remove {
/**
* Removes each entry by key.
*
* Measures mean time and memory spent per `remove` operation.
*
* Expected time: logarithmic
* Expected memory: logarithmic
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ open class Get {
/**
* Gets every value by key.
*
* Measures mean time and memory spent per `get` operation.
*
* Expected time: logarithmic
* Expected memory: none
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ open class Iterate {
/**
* Iterates all keys.
*
* Measures mean time and memory spent per `next` operation.
*
* Expected time: nearly constant (logarithmic for ordered persistent map)
* Expected memory: none once iterator is created.
*/
Expand All @@ -59,6 +61,8 @@ open class Iterate {
/**
* Iterates all values.
*
* Measures mean time and memory spent per `next` operation.
*
* Expected time: nearly constant (logarithmic for ordered persistent map)
* Expected memory: constant.
*/
Expand All @@ -72,6 +76,8 @@ open class Iterate {
/**
* Iterates all entries.
*
* Measures mean time and memory spent per `next` operation.
*
* Expected time: nearly constant (logarithmic for ordered persistent map)
* Expected memory: constant.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ open class Put {
/**
* Adds [size] entries to an empty persistent map builder.
*
* Measures mean time and memory spent per `put` operation.
*
* Expected time: logarithmic
* Expected memory: logarithmic
*/
Expand All @@ -56,6 +58,8 @@ open class Put {
/**
* Adds [size] entries to an empty persistent map builder and then gets every value by key.
*
* Measures mean time and memory spent per `put` and `get` operations.
*
* Expected time: [put] + [Get.get]
* Expected memory: [put] + [Get.get]
*/
Expand All @@ -70,6 +74,8 @@ open class Put {
/**
* Adds [size] entries to an empty persistent map builder and then iterates all keys.
*
* Measures mean time and memory spent per `put` and `next` operations.
*
* Expected time: [put] + [Iterate.iterateKeys]
* Expected memory: [put] + [Iterate.iterateKeys]
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ open class Remove {
/**
* Adds [size] entries to an empty persistent map builder and then removes each entry by key.
*
* Measures mean time and memory spent per `put` and `remove` operations.
*
* Expected time: [Put.put] + logarithmic
* Expected memory: [Put.put] + logarithmic
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ open class Add {
/**
* Adds [size] elements to an empty persistent set.
*
* Measures mean time and memory spent per `add` operation.
*
* Expected time: logarithmic
* Expected memory: logarithmic
*/
Expand All @@ -53,6 +55,8 @@ open class Add {
/**
* Adds [size] elements to an empty persistent set and then requests if every element is contained.
*
* Measures mean time and memory spent per `add` and `contains` operations.
*
* Expected time: [add] + [Contains.contains]
* Expected memory: [add] + [Contains.contains]
*/
Expand All @@ -67,6 +71,8 @@ open class Add {
/**
* Adds [size] elements to an empty persistent set and then iterates all elements.
*
* Measures mean time and memory spent per `add` and `next` operations.
*
* Expected time: [add] + [Iterate.iterate]
* Expected memory: [add] + [Iterate.iterate]
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ open class Contains {
/**
* Requests if every element is contained.
*
* Measures mean time and memory spent per `contains` operation.
*
* Expected time: logarithmic
* Expected memory: none
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ open class Iterate {
/**
* Iterates all elements.
*
* Measures mean time and memory spent per `next` operation.
*
* Expected time: nearly constant (logarithmic for ordered persistent map)
* Expected memory: none once iterator is created.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ open class Remove {
/**
* Removes each element.
*
* Measures mean time and memory spent per `remove` operation.
*
* Expected time: logarithmic
* Expected memory: logarithmic
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ open class Add {
/**
* Adds [size] elements to an empty persistent set builder.
*
* Measures mean time and memory spent per `add` operation.
*
* Expected time: logarithmic
* Expected memory: logarithmic
*/
Expand All @@ -56,6 +58,8 @@ open class Add {
/**
* Adds [size] elements to an empty persistent set builder and then requests if every element is contained.
*
* Measures mean time and memory spent per `add` and `contains` operations.
*
* Expected time: [add] + [Contains.contains]
* Expected memory: [add] + [Contains.contains]
*/
Expand All @@ -70,6 +74,8 @@ open class Add {
/**
* Adds [size] elements to an empty persistent set builder and then iterates all elements.
*
* Measures mean time and memory spent per `add` and `next` operations.
*
* Expected time: [add] + [Iterate.iterate]
* Expected memory: [add] + [Iterate.iterate]
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ open class Contains {
/**
* Requests if every element is contained.
*
* Measures mean time and memory spent per `contains` operation.
*
* Expected time: logarithmic
* Expected memory: none
*/
Expand Down
Loading

0 comments on commit 49a182c

Please sign in to comment.