Program in (-N1) runs 10 times slower than it with two threads (-N2)
|Reported by:||wuxb||Owned by:||simonmar|
|Operating System:||Linux||Architecture:||x86_64 (amd64)|
|Type of failure:||Runtime performance bug||Test Case:|
|Related Tickets:||Differential Rev(s):|
Initially I want to do some test on threads, I wrote this program(see below) to test the performance when two thread operates on same memory location. but with (-N2) rts options, it works normally, but with (-N1), the CPU work load became vary low (30%~40%). it uses much more time to finish.
no -threaded : 3.7s (wall clock time) -N2 : 4.0s (wall clock time) -N1 : 20.0s(wall clock time)
(forkIO/FFI/MVar/Ptr are used in this program). (fedora-15/ghc-7.0.4; windows-64/ghc-7.0.3).
source code & log messages will be in attached files.