I've read ScalaMeter docs and I don't understand how can I use it for benchmarking my project and not some atom hardcoded operations. Imagine I have the simple project
object SumBenchmark {
def main(args: Array[String]): Unit = {
val lst = List.fill(10000000)(1)
lst.map(x => x + 1)
val sum = lst.sum
}
}
How can I use ScalaMeter to bench it? I mean something like
performance of "SumBenchmark" in {
measure method "main" in {
// I don't know what to write here but here should be some implementation of benchmarking
}
}
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…