summaryrefslogtreecommitdiff
path: root/benchmark/vm_thread_pass.rb
blob: 438bd08d451f60fdc8c7cdba2a0bf55bf00290cd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# Plenty Thread.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}