fiber_pool: take Fibers from larger pools faster
commit604f64f624d562f480dc8424a6597ec5b32947df
authorEric Wong <normalperson@yhbt.net>
Wed, 9 May 2012 21:11:39 +0000 (9 21:11 +0000)
committerEric Wong <normalperson@yhbt.net>
Wed, 9 May 2012 21:11:39 +0000 (9 21:11 +0000)
tree03e454eb2a7fa8f637a4ac5c97a58882ec7ccc4c
parent3e61265d4193340721dd53178c43c4fa24debb79
fiber_pool: take Fibers from larger pools faster

Array#pop can be significantly faster than Array#shift on large
arrays (especially since we push into the Array).  This is
because Array#shift needs to shift all elements in the array,
and Array#pop only needs to shorten the array by one element.
The Fiber stack may also be hotter in CPU caches when we choose
the most-frequently used stack.
lib/rainbows/fiber_pool.rb