I heard once that Ruby apps would take a performance hit if there were ever more than one thread going, even if it was sleeping. Does anyone know of a good example of this, or a benchmark I could run to show this feature? Or is it just most evident when you have several threads [like over 10]? Thanks! -R
Charles Oliver Nutter
2008-Jul-03 18:46 UTC
[Eventmachine-talk] slows down with multiple threads
Roger Pack wrote:> I heard once that Ruby apps would take a performance hit if there were > ever more than one thread going, even if it was sleeping. Does anyone > know of a good example of this, or a benchmark I could run to show > this feature? > Or is it just most evident when you have several threads [like over 10]?The primary reason for this is that Ruby''s thread scheduler doesn''t run at all when you have only the main thread. If you spin up any threads (even just one additional) the thread scheduler runs and every context switch is expensive. - Charlie