views:

70

answers:

4

Hi.

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.

+2  A: 

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.

Timores
+2  A: 

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

Jojo Sardez
yes. but since I'm not allowed to use WCF and LINQ (and that would be useful in my solution after all) I'm wondering what is the benefit of this. thanks for your reply.
Txugo
If your compiling against 3.5, why would you not be allowed to use LINQ? Sounds like FUD from upper management.
mxmissile
I can't confirm or deny :-)
Txugo
+1  A: 

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.

Lucero
Exactly. that's why I said that I wasn't changing the code from 1.1 (so not using 2.0 features) and not using WCF (.NET 3.0) or Linq (3.5). So I don't understand the benefits. And a CLR in 3.5 can run a 1.1 assembly but if I compile it to 3.5 (2.0 actually) I think it doesn't make any difference. And the documentation and comments that I've searched can only say "you should still benefit" but no one explains how or why. thanks for your comment.
Txugo
+1  A: 

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.

Hans Passant