开发者

Performance gains when compiling .NET 1.1 COM+ components code with .NET 3.5 compiler

开发者 https://www.devze.com 2022-12-21 03:20 出处:网络
I need to build a service in form of a COM+ component using Enterprise Services. The service is working right now. It gets a string does some spell-checking and returns a string.

I need to build a service in form of a COM+ component using Enterprise Services.

The service is working right now. It gets a string does some spell-checking and returns a string.

My question is:开发者_运维问答

This component was compiled in .NET 1.1 but my environment is going to change to .NET 3.5 soon. So if I compile the code in .NET 3.5 (which is 2.0 actually) will I have any benefit? Any change in performance only by compiling in .NET3.5?

Bear in mind that I'm not using any .NET3.5 functionalities (or even WCF)!

Thanks for the help.


There have been optimizations in the CLR and the libraries (startup is faster for example), but it is difficult to say if you'll see any real speed difference. String manipulation implies memory allocations implies pressure on the garbage collector, so it should be a bit better in 3.5.

You'll only get a real answer by testing and measuring, sorry.


Speed wise - maybe (But take note that .Net 3.5 is even bigger than 1.1 since it includes new technologies such as LINQ, WCF, CF, WPF, etc.)

Deployment - .net 3.5 will be good since latest windows OS already has .Net framework 3.0+ available as a feature on its system.

Maintenance \ Future Considerations - .net 3.5. It will be better for you to migrate now on .Net 3.5 so if you will need to do changes on your software you can already benefit to much newer technologies available...


If you don't change the code the use newer features, such as generic collections, it's not going to change much. And most newer OS don't have .NET 1 or 1.1 installed anyways and run the code using the .NET 2 runtime (which is the runtime also used by 3.5). Therefore, you should still benefit from better jitting, interop etc. which may have been enhanced in the newer versions of the runtime.

For normal applications, one can specify in a config file which framework version shall be used, so that you can enforce the use of the .NET 2 runtime even for a 1/1.1 application. Not sure if and how this works for COM activated things, though.


Loading assemblies and JIT compiling their code was already heavily optimized in .NET 1.0. Very important since it directly affects the startup time for any .NET app. The 2.0 CLR hasn't dramatically improved this.

There was however an update in .NET 3.5 SP1 to the security policy. The strong name of an assembly is no longer checked when the assembly location is trusted. The exact rules are documented here. This can make warm starts faster by as much as 40%. That's an optimistic number, YMMV.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号