Skip to content

Instantly share code, notes, and snippets.

@mkeskells
mkeskells / code
Created November 4, 2020 22:55
overridingPairs
import com.typesafe.config.{Config, ConfigList, ConfigMergeable, ConfigObject, ConfigOrigin, ConfigResolveOptions, ConfigValue}
class CachingConfig(_config: Config) extends Config {
override def root(): ConfigObject = ???
override def origin(): ConfigOrigin = ???
override def withFallback(other: ConfigMergeable): Config = ???
override def resolve(): Config = ???
@mkeskells
mkeskells / gist:76c6badb92a72c21f948990cee40b2ce
Created February 26, 2020 14:12
2.12. immutable tree baseline
[info] Benchmark Mode Cnt Score Error Units
[info] TreeMapBenchmark.builderPlus avgt 20 432.757 ▒ 17.604 ns/op
[info] TreeMapBenchmark.builderPlus:╖gc.alloc.rate avgt 20 710.560 ▒ 28.426 MB/sec
[info] TreeMapBenchmark.builderPlus:╖gc.alloc.rate.norm avgt 20 482.801 ▒ 0.001 B/op
[info] TreeMapBenchmark.builderPlus:╖gc.churn.PS_Eden_Space avgt 20 722.717 ▒ 57.049 MB/sec
[info] TreeMapBenchmark.builderPlus:╖gc.churn.PS_Eden_Space.norm avgt 20 490.749 ▒ 28.482 B/op
[info] TreeMapBenchmark.builderPlus:╖gc.churn.PS_Survivor_Space avgt 20 0.069 ▒ 0.025 MB/sec
[info] TreeMapBenchmark.builderPlus:╖gc.churn.PS_Survivor_Space.norm avgt 20 0.
@mkeskells
mkeskells / gist:3292d9d110fccfe8f3e72a5f5f0eb149
Created February 25, 2020 00:02
ref black tree proposed structure
final class Tree[A, +B](
private var _key: A,
private var _value: AnyRef,
private var _left: Tree[A, _],
private var _right: Tree[A, _],
private var _count: Int)
{
final def count = _count & 0x7FFFFFFF
final def key = _key
final def value = _value.asInstanceOf[B]
[info] Benchmark Mode Cnt Score Error Units
[info] TreeSetBenchmark.builderPlus avgt 20 414.874 ▒ 101.896 ns/op
[info] TreeSetBenchmark.builderPlus:╖gc.alloc.rate avgt 20 752.981 ▒ 167.074 MB/sec
[info] TreeSetBenchmark.builderPlus:╖gc.alloc.rate.norm avgt 20 458.801 ▒ 0.002 B/op
[info] TreeSetBenchmark.builderPlus:╖gc.churn.PS_Eden_Space avgt 20 750.996 ▒ 164.315 MB/sec
[info] TreeSetBenchmark.builderPlus:╖gc.churn.PS_Eden_Space.norm avgt 20 458.548 ▒ 31.773 B/op
[info] TreeSetBenchmark.builderPlus:╖gc.churn.PS_Survivor_Space avgt 20 0.182 ▒ 0.076 MB/sec
[info] TreeSetBenchmark.builderPlus:╖gc.churn.PS_Survivor_Space.norm avgt 20 0.110 ▒ 0.041 B/op
[info] T
@mkeskells
mkeskells / gist:b2519ea2577d118fc93be65770fab705
Created February 22, 2020 18:23
base Treeset/Treemap benchmark
[info] Benchmark Mode Cnt Score Error Units
[info] TreeMapBenchmark.builderPlus avgt 20 501.758 ▒ 173.078 ns/op
[info] TreeMapBenchmark.builderPlus:╖gc.alloc.rate avgt 20 707.646 ▒ 233.010 MB/sec
[info] TreeMapBenchmark.builderPlus:╖gc.alloc.rate.norm avgt 20 482.801 ▒ 0.003 B/op
[info] TreeMapBenchmark.builderPlus:╖gc.churn.PS_Eden_Space avgt 20 708.336 ▒ 242.180 MB/sec
[info] TreeMapBenchmark.builderPlus:╖gc.churn.PS_Eden_Space.norm avgt 20 479.811 ▒ 29.256 B/op
[info] TreeMapBenchmark.builderPlus:╖gc.churn.PS_Survivor_Space avgt 20 0.112 ▒ 0.056 MB/sec
[info] TreeMapBenchmark.builderPlus:╖gc.churn.PS_Survivor_Space.norm avgt 20
@mkeskells
mkeskells / results
Created February 17, 2020 07:52
set benchmark - before
[info] Benchmark (colliding) (op) (sharing) (size) Mode Cnt Score Error Units
[info] HashSetBuilderSharedBenchmark.opWithOverlapShared false Set+= 0 10 avgt 31831.068 ns/op
[info] HashSetBuilderSharedBenchmark.opWithOverlapShared:Àgc.alloc.rate false Set+= 0 10 avgt 909.953 MB/sec
[info] HashSetBuilderSharedBenchmark.opWithOverlapShared:Àgc.alloc.rate.norm false Set+= 0 10 avgt 45450.416 B/op
[info] HashSetBuilderSharedBenchmark.opWithOverlapShared:Àgc.churn.PS_Eden_Space false Set+= 0 10 avgt 679.000 MB/sec
[info] HashSetBuilderSharedBenchmark.opWithOverlapShared:Àgc.churn.PS_Eden_Space.norm
@mkeskells
mkeskells / after
Last active December 12, 2019 00:44
HashSet before and after
[info] Benchmark (sharing) (size) Mode Cnt Score Error Units
[info] HashSetPlusPlusBenchmark.opContainedWithLarge 0 10 avgt 20 422.985 ▒ 3.649 ns/op
[info] HashSetPlusPlusBenchmark.opContainedWithLarge 0 100 avgt 20 11030.800 ▒ 305.684 ns/op
[info] HashSetPlusPlusBenchmark.opContainedWithLarge 0 1000 avgt 20 97682.239 ▒ 9048.045 ns/op
[info] HashSetPlusPlusBenchmark.opContainedWithLarge 0 10000 avgt 20 1659434.234 ▒ 27740.896 ns/op
[info] HashSetPlusPlusBenchmark.opContainedWithLarge 0 100000 avgt 20 27916736.500 ▒ 2031136.722 ns/op
[info] HashSetPlusPlusBenchmark.opContainedWithLarge 20 10 avgt 20 425.682 ▒ 4.552 ns/op
[info] HashSetPlusPlusBenchmark.opContainedWithLarge 20 100 avgt 20 11523.108 ▒ 145.613 ns/op
[info] HashSetPlusPlusBenchmark.opContainedWithLarge 20 1000
[info] Benchmark (sharing) (size) Mode Cnt Score Error Units
[info] HashMapPlusPlusBenchmark.opContainedWithLarge 0 10 avgt 20 612.830 ▒ 23.476 ns/op
[info] HashMapPlusPlusBenchmark.opContainedWithLarge:Àgc.alloc.rate 0 10 avgt 20 102.272 ▒ 3.772 MB/sec
[info] HashMapPlusPlusBenchmark.opContainedWithLarge:Àgc.alloc.rate.norm 0 10 avgt 20 98.401 ▒ 0.002 B/op
[info] HashMapPlusPlusBenchmark.opContainedWithLarge:Àgc.churn.PS_Eden_Space 0 10 avgt 20 102.181 ▒ 8.353 MB/sec
[info] HashMapPlusPlusBenchmark.opContainedWithLarge:Àgc.churn.PS_Eden_Space.norm 0 10 avgt 20 98.244 ▒ 6.563 B/op
[info] HashMapPlusPlusBenchmark.opContainedWithLarge:Àgc.churn.PS_Survivor_Space 0 10 avgt
[info] Benchmark (op) (sharing) (size) Mode Cnt Score Error Units
[info] HashMapBulkBenchmark.opContainedWithLarge ++ 0 10 avgt 20 ? 10?? ms/op
[info] HashMapBulkBenchmark.opContainedWithLarge:Àgc.alloc.rate ++ 0 10 avgt 20 0.001 ▒ 0.002 MB/sec
[info] HashMapBulkBenchmark.opContainedWithLarge:Àgc.alloc.rate.norm ++ 0 10 avgt 20 ? 10?? B/op
[info] HashMapBulkBenchmark.opContainedWithLarge:Àgc.count ++ 0 10 avgt 20 ? 0 counts
[info] HashMapBulkBenchmark.opContainedWithLarge ++ 0 100 avgt 20 ? 10?? ms/op
[info] HashMapBulkBenchmark.opContainedWithLarge:Àgc.alloc.rate ++ 0 100 avgt 20 0.001 ▒ 0.
@mkeskells
mkeskells / full run
Last active June 21, 2019 06:32
interner benchmark
[info] Iteration 2: 433.998 ▒(99.9%) 96.223 ns/op
[info] Iteration 3: 437.692 ▒(99.9%) 124.927 ns/op
[info] Iteration 4: 422.283 ▒(99.9%) 64.590 ns/op
[info] Iteration 5: 429.251 ▒(99.9%) 142.367 ns/op
[info] Iteration 6: 427.149 ▒(99.9%) 168.279 ns/op
[info] Iteration 7: 437.630 ▒(99.9%) 185.539 ns/op
[info] Iteration 8: 914.072 ▒(99.9%) 247.350 ns/op
[info] Iteration 9: 3226.019 ▒(99.9%) 2431.673 ns/op
[info] Iteration 10: 3203.641 ▒(99.9%) 556.753 ns/op
[info]