summaryrefslogtreecommitdiff
path: root/benchmark/bm_vm_thread_pass.rb
blob: b5b3c0bc85062217cf9bcce3cf69f62bcf76f34e (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 = 200_000 / tmax

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