代码之家  ›  专栏  ›  技术社区  ›  Ovidiu Pacurar

如何解释mono profiler结果?

  •  3
  • Ovidiu Pacurar  · 技术社区  · 15 年前

    我用c创建了一个控制台应用程序,在windows/.net上运行它比在linux/mono或windows/mono上快5倍。 应用程序将一些二进制文件编码为文本格式(json)。

    我在linux/mono上分析了这个应用程序,使用:

    mono --profile=default:stat myconsoleapp.exe
    

    结果的第一部分是:

    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内部使用的是总执行时间的四分之三吗?

    编辑:这是“mono——version”的结果

    Mono JIT compiler version 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
    
    1 回复  |  直到 15 年前
        1
  •  1
  •   lupus    15 年前

    对的。 看起来你的mono二进制文件的符号被去掉了,所以你得不到更精确的信息。

    我猜大部分的开销都在十进制代码和(可能)GC中。

    对于第一种情况:您使用的是什么单声道版本?IIRC,我们最近解决了这个领域的一些性能问题。从svn主干尝试mono可能是个好主意。

    如果开销来自gc,那么我们正在实现的新gc应该会有所帮助。

    如果您发布了测试程序的源代码或二进制代码,我们可以确认其中一个问题。