summaryrefslogtreecommitdiff
path: root/benchmark/bm_vm4_thread_pass.rb
blob: 171bfecbfe9aba9732e4785e392ca6510582ea7a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# Plenty Thtread.pass
# A performance may depend on GVL implementation.

tmax = (ARGV.shift || 2).to_i
lmax = 2_000_000 / tmax

(1..tmax).map{
  Thread.new{
    lmax.times{
      Thread.pass
    }
  }
}.each{|t| t.join}