Performance/Concurrency

From HaskellWiki
Jump to navigation Jump to search

This page is just a start.

When using -threaded, never use the main thread to do the real work. Communication between the main thread and other forkIO'd threads is much much slower than between two forkIO'd threads, because the main thread is a "bound thread" (i.e. it has an OS thread to itself). This is perhaps the main reason that turning on -threaded will make the version of threadring above go much slower.