example benchmarks translated to scala