你能直接在CIL中编写代码吗? [英] Can you write code directly in CIL ???

查看:79
本文介绍了你能直接在CIL中编写代码吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您可以使用Common Intermediate语言直接编写代码吗?我需要

优化关键的实时功能。

Cab you write code directly in the Common Intermediate language? I need to
optimize a critical real-time function.

推荐答案

彼得,


您可以编写它,但是您必须使用IL创建一个模块,然后将
编译到您的程序集中(或者只编写整个程序集)。


另外,您认为可以进行哪些优化?最终,你不会因为Windows不是实时操作系统而遭受损失,而你所能做的一切都不会改变这一点。最重要的是,JIT是你试图在你的代码之后再次优化你的代码,所以你实际上可能最终会伤害你自己而不是帮助
你自己。


如果你发布了你想要优化的代码,我们可以试着告诉你

你可能会做些改进,但是IL级别是

很可能对你没什么帮助。

-

- Nicholas Paldino [.NET / C#MVP] < br $> b $ b - mv*@spam.guard.caspershouse.com

" ; Peter Olcott <醇**** @ att.net>在消息中写道

news:7t%rf.37887
Peter,

You can write it, but you would have to create a module with IL, and
then compile that into your assembly (or just write the whole assembly).

Also, what optimizations do you think you can make? Ultimately, you
suffer from the fact that Windows is not a real-time OS, and nothing you can
do will change that. On top of that, the JIT is what''s going to optimize
your code again after you try to, so you might actually end up hurting
yourself more than helping yourself.

If you post the code you are trying to optimize, we can try and tell you
where you might make some improvements, but dipping down to the IL level is
most likely not going to help you much.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"Peter Olcott" <ol****@att.net> wrote in message
news:7t%rf.37887


QW2.9998@dukeread08 ...
QW2.9998@dukeread08...
Cab直接编写代码在通用中级语言?我需要优化关键的实时功能。
Cab you write code directly in the Common Intermediate language? I need to
optimize a critical real-time function.



我需要最佳的执行速度。我发现各种编译器生成的代码质量差异很大。我目前的项目中有16,000小时的开发时间。有一个100行

函数,执行时间不得超过1/10秒。我几乎可以用MSVC ++ 6.0来实现这个目标。 MSVC ++ 7.0已经进行了一些优化

禁用。我最终需要将其移植到C#.NET。这是一个案例,其中

手动调整汇编语言是合适的。我认为手调整了

CIL将是.NET相当于手动调整汇编语言。


Nicholas Paldino [.NET / C#MVP]" ; < mv*@spam.guard.caspershouse.com>写在

消息新闻:OC ************** @ TK2MSFTNGP09.phx.gbl ...
I need the best possible execution speed. I have found that there is a large
difference in the quality of the code generated by the various compilers. I have
16,000 hours of development time in my current project. There is a 100 line
function that must take no longer than 1/10 second to execute. I can just barely
achieve this with MSVC++ 6.0. MSVC++ 7.0 has had some of its optimizations
disabled. I eventually will need to port this to C# .NET. This is a case where
hand tweaked assembly language would be appropriate. I figured that hand tweaked
CIL would be the .NET equivalent of hand tweaked assembly language.

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in
message news:OC**************@TK2MSFTNGP09.phx.gbl...
Peter,
您可以编写它,但是您必须使用IL创建一个模块,然后将其编译到您的程序集中(或者只编写整个程序集)。

另外,您认为可以做出哪些优化?最终,您不会因为Windows不是实时操作系统而受到影响,而您无能为力将改变这一点。最重要的是,JIT是你尝试后再次优化代码的原因,所以你最终可能会伤害自己,而不是帮助自己。
您可能会在哪些方面进行一些改进,但是下降到IL级别很可能不会对您有所帮助。

-
- Nicholas Paldino [.NET / C#MVP]
- mv *@spam.guard.caspershouse.com

" Peter Olcott" <醇**** @ att.net>在消息中写道
新闻:7t%rf.37887
Peter,

You can write it, but you would have to create a module with IL, and then
compile that into your assembly (or just write the whole assembly).

Also, what optimizations do you think you can make? Ultimately, you suffer
from the fact that Windows is not a real-time OS, and nothing you can do will
change that. On top of that, the JIT is what''s going to optimize your code
again after you try to, so you might actually end up hurting yourself more
than helping yourself.

If you post the code you are trying to optimize, we can try and tell you
where you might make some improvements, but dipping down to the IL level is
most likely not going to help you much.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"Peter Olcott" <ol****@att.net> wrote in message
news:7t%rf.37887


这篇关于你能直接在CIL中编写代码吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆