#1523: Constant overhead of threadDelay
----------------------------+-----------------------------------------------
Reporter: chak | Owner:
Type: bug | Status: new
Priority: normal | Milestone: 6.8.3
Component: libraries/base | Version: 6.7
Severity: normal | Resolution:
Keywords: | Difficulty: Unknown
Testcase: | Architecture: x86
Os: MacOS X |
----------------------------+-----------------------------------------------
Comment (by thorkilnaur):
For comparison, on a x86 SuSE Linux, here are some measurements using two
different GHC versions:
{{{
[EMAIL PROTECTED]:~/tn/test/GHC/trac/1523/work> ghc --version
The Glorious Glasgow Haskell Compilation System, version 6.4.1
[EMAIL PROTECTED]:~/tn/test/GHC/trac/1523/work> ghc --make threadDelayTest1.hs
-o
threadDelayTest1
Chasing modules from: threadDelayTest1.hs
Compiling Main ( threadDelayTest1.hs, threadDelayTest1.o )
Linking ...
[EMAIL PROTECTED]:~/tn/test/GHC/trac/1523/work> time ./threadDelayTest1 1000000
Performing 1 delays of 1000000 microsecs
Done
real 0m1.124s
user 0m0.000s
sys 0m0.016s
[EMAIL PROTECTED]:~/tn/test/GHC/trac/1523/work> time ./threadDelayTest1 1000000
Performing 1 delays of 1000000 microsecs
Done
real 0m1.006s
user 0m0.000s
sys 0m0.004s
[EMAIL PROTECTED]:~/tn/test/GHC/trac/1523/work> time ./threadDelayTest1 100000
Performing 10 delays of 100000 microsecs
Done
real 0m1.188s
user 0m0.000s
sys 0m0.008s
[EMAIL PROTECTED]:~/tn/test/GHC/trac/1523/work> time ./threadDelayTest1 10000
Performing 100 delays of 10000 microsecs
Done
real 0m2.002s
user 0m0.144s
sys 0m1.832s
[EMAIL PROTECTED]:~/tn/test/GHC/trac/1523/work> time ./threadDelayTest1 1000
Performing 1000 delays of 1000 microsecs
Done
real 0m19.987s
user 0m1.952s
sys 0m16.749s
[EMAIL PROTECTED]:~/tn/test/GHC/trac/1523/work>
/home/tn/tn/install/ghc-6.8.2/bin/ghc --version
The Glorious Glasgow Haskell Compilation System, version 6.8.2
[EMAIL PROTECTED]:~/tn/test/GHC/trac/1523/work>
/home/tn/tn/install/ghc-6.8.2/bin/ghc --make threadDelayTest1.hs -o
threadDelayTest1
[1 of 1] Compiling Main ( threadDelayTest1.hs,
threadDelayTest1.o )
Linking threadDelayTest1 ...
[EMAIL PROTECTED]:~/tn/test/GHC/trac/1523/work> time ./threadDelayTest1 1000000
Performing 1 delays of 1000000 microsecs
Done
real 0m1.165s
user 0m0.008s
sys 0m0.000s
[EMAIL PROTECTED]:~/tn/test/GHC/trac/1523/work> time ./threadDelayTest1 1000000
Performing 1 delays of 1000000 microsecs
Done
real 0m1.020s
user 0m0.000s
sys 0m0.000s
[EMAIL PROTECTED]:~/tn/test/GHC/trac/1523/work> time ./threadDelayTest1 100000
Performing 10 delays of 100000 microsecs
Done
real 0m1.202s
user 0m0.000s
sys 0m0.004s
[EMAIL PROTECTED]:~/tn/test/GHC/trac/1523/work> time ./threadDelayTest1 10000
Performing 100 delays of 10000 microsecs
Done
real 0m4.001s
user 0m0.004s
sys 0m0.000s
[EMAIL PROTECTED]:~/tn/test/GHC/trac/1523/work> time ./threadDelayTest1 1000
Performing 1000 delays of 1000 microsecs
Done
real 0m40.003s
user 0m0.000s
sys 0m0.004s
[EMAIL PROTECTED]:~/tn/test/GHC/trac/1523/work>
}}}
Best regards
Thorkil
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/1523#comment:9>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs