How to interpret mono profiler results?
I created a console application in C# and running it on windows/.NET is 5x faster than on linux/mono or windows/mono. The app encodes some binary files into text format(JSON).
I profiled the app on linux/mono using:
mono --profile=default:stat myconsoleapp.exe
Here is the first part of the result:
prof counts: total/unmanaged: 32274/25062
23542 72.95 % mono
459 1.42 % System.Decimal:Divide (System.Decimal,System.Decimal)
457 1.42 % System.Decimal:Round (System.Decimal,int,System.MidpointRounding)
411 1.27 % /lib/libz.so.1
262 0.81 % /lib/tls/i686/cmov/libc.so.6(memmove
253 0.78 % System.Decimal:IsZero ()
247 0.77 % System.NumberFormatter:Init (string,double,int)
213 0.66 % System.NumberFormatter:AppendDigits (int,int)
72.95 % mono? Are mono internals using 3 quarters of the total execution time?
EDIT: Here is the result of "mono --version"
Mono JIT compiler ver开发者_StackOverflowsion 2.4.2.3 (Debian 2.4.2.3+dfsg-2)
Copyright (C) 2002-2008 Novell, Inc and Contributors. www.mono-project.com
TLS: __thread
GC: Included Boehm (with typed GC)
SIGSEGV: altstack
Notifications: epoll
Architecture: x86
Disabled: none
Correct. It looks like your mono binary has its symbols stripped so you're not getting more precise info.
My guess is that most of that overhead is in the decimal code and (possibly) in the GC.
For the first case: what mono version are you using? IIRC, we fixed some performance issues in that area recently. It may be a good idea to try mono from svn trunk.
If the overhead comes from the GC the new GC we're implementing should help with it.
We could confirm either issue if you posted the source or the binary of your test program.
精彩评论