ScalaMeter is a performance testing framework for Scala, Java and other JVM languages.
Questions tagged [scalameter]
15 questions
13
votes
3 answers
ArrayList and HashSet memory allocation strange test results
I was inspired by this topic: Performance and Memory allocation comparision between List and Set to actually run some tests and measure the performance difference between ArrayList and HashSet.
The most upvoted answer, in the mentioned topic, that…

Atais
- 10,857
- 6
- 71
- 111
3
votes
0 answers
ScalaMeter: Test threw exception
Just my first time with ScalaMeter and Scala. I'm trying to test two simple methods and I wrote, based on the samples given in the ScalaMeter Simple benchmark page the following code:
import org.scalameter.api._
object RangeBenchmark extends…

Guidone
- 31
- 4
3
votes
1 answer
sbt + Intellij IDEA: dependencies from git?
I am trying to manage my projects dependencies with sbt and I am having trouble with getting things from GitHub. I tried doing a kind of multi-project-dependency something or other, but that just broke what I already had. My end goal is being able…

Evan Walsh
- 443
- 6
- 16
2
votes
1 answer
Testing performance of parallel actions with ScalaMeter
I have used the basic example taken from ScalaMeter's example repository (https://github.com/scalameter/scalameter-examples). The code of the example is as follows:
measure method "map" in {
using(ranges) in { r =>
r.map(_ + 1)
}
}
In my…

Atais
- 10,857
- 6
- 71
- 111
2
votes
1 answer
Setting testFrameworks for a specific SBT configuration
I'm trying to integrate ScalaMeter into a separate configuration of our build. I want to run all performance tests in a separate configuration, since they are naturally slow. In Build.scala I have:
lazy val ItTest = config("it").extend(Test)
…

Alexey Romanov
- 167,066
- 35
- 309
- 487
1
vote
0 answers
Scalameter task not being found
I'm trying to add scalameter tests to an existing project of mine. According to the docs, I can add this code to my build.sbt and then I should be able to invoke sbt bench:test and have only the benchmarks run. However, when I run the command, I get…

CalumMcCall
- 1,665
- 4
- 24
- 46
1
vote
1 answer
How can ScalaMeter chain configuration
I'm quite confusing on how can ScalaMeter chain configuration like this
val standardConfig = config(
Key.exec.minWarmupRuns -> 5,
Key.exec.maxWarmupRuns -> 10,
Key.exec.benchRuns -> 10,
Key.verbose -> true
) withWarmer(new…

Korntewin Boonchuay
- 87
- 6
1
vote
1 answer
Why is parallel pi estimation slower than sequential pi estimation?
So I tried coming up with different implementations of pi estimation, based on montecarlo method. There are 3 implementations -
Sequential - Faster performance results
Scala parallel collections - Slowest results
Scala futures - Faster than…

Dhruv Kapur
- 726
- 1
- 8
- 24
1
vote
1 answer
Can I use ScalaMeter with no input?
I want to benchmark the runtime of several methods in my Scala application, and I am looking into using ScalaMeter. Let's say I want to measure the time of a method called doSomething().
I only want to call doSomething and measure the time it takes…

hayfreed
- 525
- 7
- 21
1
vote
1 answer
How to implement a generator for scalameter
I'm currently trying to benchmark an algorithm that pulls data from a database and performs operations on it, the function takes a little longer then I'd like and I would like to benchmark it so I can monitor any performance increase (as well as…

Justin Juntang
- 121
- 1
- 5
0
votes
1 answer
Can scalameter be imported to scala3 projects (and how)?
I tried to use scalameter 0.21 (and some other versions) with scala 3.1.2.
I added some configurations from the scalameter web-page in my build.sbt file and tried serveral things to make this work, but sbt was not able to find the desired…

Michael W.
- 182
- 1
- 12
0
votes
0 answers
How to use different reporters in scalameter?
I want to try using some reporters in my benchmark for function Main.lengthOfUUID.
object Main {
def lengthOfUUID(s : Int) = {
val x = List.fill(100000)(1)
val sum = x.sum
}
}
Firstly I tried ChartReporter
import…

Nourless
- 729
- 1
- 5
- 18
0
votes
1 answer
How should I use ScalaMeter for my project?
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 =…

Nourless
- 729
- 1
- 5
- 18
0
votes
1 answer
Scala: overloaded method value converged with alternatives:
I am still new to Scala (still learning it). I have the following assignment, but am having problems running it due to the error "overloaded method value converged with alternatives:"
Full Error:
\KMeans.scala:101:8: overloaded method value…

Vladimir Lenin
- 75
- 4
0
votes
1 answer
How to Microbenchmark using data from a file?
I'm trying to microbenchmark two different implementations of calculating a running median using Scalameter. I've some test files, small and large, from where the numbers are going to come from. Problem is, the following code completes instantly…

Abhijit Sarkar
- 21,927
- 20
- 110
- 219