you should probably use distinct instead of toSet:
scala> th.pbenchOff()((1 to 1000).toSet.size)((1 to 1000).distinct.size)
Benchmark comparison (in 23.17 s)
Significantly different (p ~= 0)
Time ratio: 0.43815 95% CI 0.42991 - 0.44639 (n=20)
First 125.6 us 95% CI 124.0 us - 127.2 us