ComputeId

com.netflix.atlas.core.model.ComputeId
class ComputeId

Check performance of TaggedItem.computeId. It is in the hot path when processing new metrics that come in via publish.

> jmh:run -prof gc -prof stack -wi 5 -i 5 -f1 -t1 .*ComputeId.*
...
Benchmark                             Mode  Cnt       Score       Error   Units
computeIdNaive                       thrpt    5  326439.391 ± 30418.108   ops/s
computeIdSmallTagMap                 thrpt    5  512260.825 ± 36192.269   ops/s
computeIdSortedTagMap                thrpt    5  578262.359 ± 70766.713   ops/s
computeIdTagMap                      thrpt    5  519393.255 ± 16961.856   ops/s

Benchmark                             Mode  Cnt       Score       Error   Units
computeIdNaive                       alloc    5    8408.000 ±     0.001    B/op
computeIdSmallTagMap                 alloc    5      64.000 ±     0.001    B/op
computeIdSortedTagMap                alloc    5      64.000 ±     0.001    B/op
computeIdTagMap                      alloc    5      80.000 ±     0.001    B/op

Note, the naive method is mostly problematic in terms of allocated data, not throughput. For this benchmark it allocates over 25GB for the top 5 objects compared to 5GB to 6GB when using computeId.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def computeIdNaive(bh: Blackhole): Unit
def computeIdSmallTagMap(bh: Blackhole): Unit
def computeIdSortedTagMap(bh: Blackhole): Unit
def computeIdTagMap(bh: Blackhole): Unit