如何解释单声道分析器结果?

发布于 2024-08-30 18:03:47 字数 1172 浏览 2 评论 0原文

我用 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

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 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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

裂开嘴轻声笑有多痛 2024-09-06 18:03:47

正确的。
看起来您的单二进制文件的符号已被删除,因此您无法获得更准确的信息。

我的猜测是,大部分开销都在十进制代码中,并且(可能)在 GC 中。

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

如果开销来自 GC,我们正在实施的新 GC 应该会有所帮助。

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

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文