in scrooge-benchmark/src/main/scala/com/twitter/scrooge/benchmark/CollectionsBenchmark.scala [37:76]
def timeEncodeList(state: CollectionsState): Unit =
state.col.encode(
ListCollections,
state.col.listProt,
state.col.list,
state.col.listCollections
)
@Benchmark
def timeEncodeArray(state: CollectionsState): Unit =
state.col.encode(
ListCollections,
state.col.listProt,
state.col.list,
state.col.arrayCollections
)
@Benchmark
def timeEncodeDoubleArray(state: CollectionsState): Unit =
state.col.encode(
ListDoubleCollections,
state.col.listDoubleProt,
state.col.listDouble,
state.col.arrayDoubleCollections
)
@Benchmark
def timeDecodeMap(state: CollectionsState): Unit =
state.col.decode(MapCollections, state.col.mapProt, state.col.map)
@Benchmark
def timeDecodeSet(state: CollectionsState): Unit =
state.col.decode(SetCollections, state.col.setProt, state.col.set)
@Benchmark
def timeDecodeList(state: CollectionsState): Unit =
state.col.decode(ListCollections, state.col.listProt, state.col.list)
}
class CollectionsBenchmarkState(size: Int) {