summaryrefslogtreecommitdiff
path: root/benchmark/vm_thread_pass.rb
blob: e5f23526106e4332e30c279cdf9951c2784c5d44 (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 || 8).to_i
lmax = 400_000 / tmax

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