Hello all, A friend and I are trying to benchmark some network server code which runs fine on my OSX laptop (~7500 req/s) but which is >10x slower on a much faster 8-core Xeon Linux box. The profiling run on Linux looks like this: individual inherited COST CENTRE MODULE no. entries %time %alloc %time %alloc MAIN MAIN 1 0 95.7 0.2 100.0 100.0 ... How should we interpret this result? MAIN doesn't seem to correspond to any user code so we're wondering where the time is going. G. -- Gregory Collins <greg@gregorycollins.net>
Am Montag 08 Februar 2010 17:04:44 schrieb Gregory Collins:
Hello all,
A friend and I are trying to benchmark some network server code which runs fine on my OSX laptop (~7500 req/s) but which is >10x slower on a much faster 8-core Xeon Linux box.
The profiling run on Linux looks like this:
individual inherited COST CENTRE MODULE no. entries %time %alloc %time %alloc
MAIN MAIN 1 0 95.7 0.2 100.0 100.0 ...
How should we interpret this result? MAIN doesn't seem to correspond to any user code so we're wondering where the time is going.
Insert lots of {-# SCC "foo" #-} pragmas (you did pass -auto-all on the command line when compiling?). You can't interpret a profile where almost everything is attributed to MAIN or main.
G.
Daniel Fischer <daniel.is.fischer@web.de> writes:
The profiling run on Linux looks like this:
individual inherited COST CENTRE MODULE no. entries %time %alloc %time %alloc
MAIN MAIN 1 0 95.7 0.2 100.0 100.0 ...
Insert lots of {-# SCC "foo" #-} pragmas (you did pass -auto-all on the command line when compiling?). You can't interpret a profile where almost everything is attributed to MAIN or main.
The -auto-all flag is on. The actual "main" function only takes up 3.5% of the inherited time, and the program is only spending 2.4% of its time doing GC. Main itself is pretty trivial -- it creates an MVar, runs the server in a forkIO (to get the accept() loop out of the main thread, as suggested by http://haskell.org/haskellwiki/Simple_Servers), and blocks on the mvar until the accept loop is terminated. I'm just curious as to what the meaning of the MAIN cost centre is -- is it just a catch-all bucket? Are we measuring time spent in the runtime system? G -- Gregory Collins <greg@gregorycollins.net>
Am Montag 08 Februar 2010 18:15:30 schrieb Gregory Collins:
I'm just curious as to what the meaning of the MAIN cost centre is -- is it just a catch-all bucket? Are we measuring time spent in the runtime system?
G
MAIN is always the root of the call-tree, so I think it's the cost-centre which subsumes all. That its inherited cost is 100% is natural, thus. But usually, its individual cost is 0%, so there's something strange going on.
Daniel Fischer <daniel.is.fischer@web.de> writes:
Am Montag 08 Februar 2010 18:15:30 schrieb Gregory Collins:
I'm just curious as to what the meaning of the MAIN cost centre is -- is it just a catch-all bucket? Are we measuring time spent in the runtime system?
G
MAIN is always the root of the call-tree, so I think it's the cost-centre which subsumes all. That its inherited cost is 100% is natural, thus. But usually, its individual cost is 0%, so there's something strange going on.
We've been thinking it might be http://hackage.haskell.org/trac/ghc/ticket/3758 (my laptop is 6.10 and the linux box is 6.12) but removing -threaded doesn't improve the situation. G -- Gregory Collins <greg@gregorycollins.net>
participants (2)
-
Daniel Fischer -
Gregory Collins