C# .NET question
-
C# .NET question My first and main question is: Can C# produce native executables, that would run on any Windows platoform without the .NET binaries? Just like C++? Or it only compiles to bytecode like Java? (it doesn't matter how MS calls it?) Do you think that C# is good for Graphics Applications? (I mean is it fast enough) I would like to try .NET SDK and online documentation before I move to VS .NET. Do you know about any online books on C# (beside C# Language Specification and Thinking in C#)? I think a FAQ on C# would answer this question but so far I couldn't find any with the anwsers I want. Any help is appreciated. Thank you, Z.
-
C# .NET question My first and main question is: Can C# produce native executables, that would run on any Windows platoform without the .NET binaries? Just like C++? Or it only compiles to bytecode like Java? (it doesn't matter how MS calls it?) Do you think that C# is good for Graphics Applications? (I mean is it fast enough) I would like to try .NET SDK and online documentation before I move to VS .NET. Do you know about any online books on C# (beside C# Language Specification and Thinking in C#)? I think a FAQ on C# would answer this question but so far I couldn't find any with the anwsers I want. Any help is appreciated. Thank you, Z.
Zimbar wrote: My first and main question is: Can C# produce native executables, that would run on any Windows platoform without the .NET binaries? Just like C++? Or it only compiles to bytecode like Java? no, c# does not compile to a win32 executable. Zimbar wrote: Do you think that C# is good for Graphics Applications? (I mean is it fast enough) except for very extreme examples ( like maybe a game engine or something ), c# will be fast enough.
-
C# .NET question My first and main question is: Can C# produce native executables, that would run on any Windows platoform without the .NET binaries? Just like C++? Or it only compiles to bytecode like Java? (it doesn't matter how MS calls it?) Do you think that C# is good for Graphics Applications? (I mean is it fast enough) I would like to try .NET SDK and online documentation before I move to VS .NET. Do you know about any online books on C# (beside C# Language Specification and Thinking in C#)? I think a FAQ on C# would answer this question but so far I couldn't find any with the anwsers I want. Any help is appreciated. Thank you, Z.
Zimbar wrote: My first and main question is: Can C# produce native executables, that would run on any Windows platoform without the .NET binaries? No, the C# compiler only compiles down to MSIL bytecode. Zimbar wrote: Do you think that C# is good for Graphics Applications? (I mean is it fast enough) Probably not; but you could always try it to see. James "Java is free - and worth every penny." - Christian Graus
-
C# .NET question My first and main question is: Can C# produce native executables, that would run on any Windows platoform without the .NET binaries? Just like C++? Or it only compiles to bytecode like Java? (it doesn't matter how MS calls it?) Do you think that C# is good for Graphics Applications? (I mean is it fast enough) I would like to try .NET SDK and online documentation before I move to VS .NET. Do you know about any online books on C# (beside C# Language Specification and Thinking in C#)? I think a FAQ on C# would answer this question but so far I couldn't find any with the anwsers I want. Any help is appreciated. Thank you, Z.
Zimbar wrote: ++? Or it only compiles to bytecode like Java? That is sort of right. But yes, you need the runtime. Zimbar wrote: Do you think that C# is good for Graphics Applications? (I mean is it fast enough) No. My graphics filters were benchmarked by Chris L. and the same code in C++ was 25 times the speed. I wrote mine in C# only because I needed to, to differentiate them from some I wrote in C++ for a former employer. Christian come on all you MS suckups, defend your sugar-daddy now. - Chris Losinger - 11/07/2002
-
Zimbar wrote: ++? Or it only compiles to bytecode like Java? That is sort of right. But yes, you need the runtime. Zimbar wrote: Do you think that C# is good for Graphics Applications? (I mean is it fast enough) No. My graphics filters were benchmarked by Chris L. and the same code in C++ was 25 times the speed. I wrote mine in C# only because I needed to, to differentiate them from some I wrote in C++ for a former employer. Christian come on all you MS suckups, defend your sugar-daddy now. - Chris Losinger - 11/07/2002
25x? That seems surprising. Care to share a bit of code (both in C++ and in C#)?
-
25x? That seems surprising. Care to share a bit of code (both in C++ and in C#)?
My C# code is here on the site - I did not think the speed was too bad ( but I maintain C# is the wrong tool, mostly because Microsoft in their wisdom have made pixel access 'unsafe' ), but Chris Losinger has posted the question based on conversion to C++ that he did. Christian come on all you MS suckups, defend your sugar-daddy now. - Chris Losinger - 11/07/2002
-
My C# code is here on the site - I did not think the speed was too bad ( but I maintain C# is the wrong tool, mostly because Microsoft in their wisdom have made pixel access 'unsafe' ), but Chris Losinger has posted the question based on conversion to C++ that he did. Christian come on all you MS suckups, defend your sugar-daddy now. - Chris Losinger - 11/07/2002
-
Two questions: 1) Was the code written using GetPixel and SetPixel()? 2) What other option was there besides making pixel access unsafe? I don't like it either, but I can't see how you can be fast without being pointer-based.
Anonymous wrote: Was the code written using GetPixel and SetPixel()? Mine was not, that would not be unsafe. I assume Chris' was not either - he writes an imaging library, you know. Anonymous wrote: What other option was there besides making pixel access unsafe? I don't like it either, but I can't see how you can be fast without being pointer-based. The obvious option is a function that returns the bitmap as a 2D array. How do you think every array in memory is laid out ? There is no reason to regard it as unsafe to access the member data of the Bitmap class. Christian come on all you MS suckups, defend your sugar-daddy now. - Chris Losinger - 11/07/2002
-
C# .NET question My first and main question is: Can C# produce native executables, that would run on any Windows platoform without the .NET binaries? Just like C++? Or it only compiles to bytecode like Java? (it doesn't matter how MS calls it?) Do you think that C# is good for Graphics Applications? (I mean is it fast enough) I would like to try .NET SDK and online documentation before I move to VS .NET. Do you know about any online books on C# (beside C# Language Specification and Thinking in C#)? I think a FAQ on C# would answer this question but so far I couldn't find any with the anwsers I want. Any help is appreciated. Thank you, Z.
-
Anonymous wrote: Was the code written using GetPixel and SetPixel()? Mine was not, that would not be unsafe. I assume Chris' was not either - he writes an imaging library, you know. Anonymous wrote: What other option was there besides making pixel access unsafe? I don't like it either, but I can't see how you can be fast without being pointer-based. The obvious option is a function that returns the bitmap as a 2D array. How do you think every array in memory is laid out ? There is no reason to regard it as unsafe to access the member data of the Bitmap class. Christian come on all you MS suckups, defend your sugar-daddy now. - Chris Losinger - 11/07/2002
Sorry that the last one came across as anonymous. Not sure why... Christian Graus wrote: The obvious option is a function that returns the bitmap as a 2D array. How do you think every array in memory is laid out ? There is no reason to regard it as unsafe to access the member data of the Bitmap class. Hmm. Did the C++ version use pointer arithmetic, or did it use array indexing? I agree that you can return a 2D array, but I don't that would help much in this case because: 1) multidimensional access in C# is a bit slower than single dimensional 2) Array indexing is slower than pointer arithmetic 3) The .NET classes are a thin layer on top of the unmanaged GDI+ functions. If you can't change that, then you'd have to copy from the unmanaged world to the managed world and back, which would be really slow. #3 is a design decision which I hope can be addressed in the future. I'm not sure what we'd do to address the others. Thanks for the info; I'll take a look at the code.
-
Sorry that the last one came across as anonymous. Not sure why... Christian Graus wrote: The obvious option is a function that returns the bitmap as a 2D array. How do you think every array in memory is laid out ? There is no reason to regard it as unsafe to access the member data of the Bitmap class. Hmm. Did the C++ version use pointer arithmetic, or did it use array indexing? I agree that you can return a 2D array, but I don't that would help much in this case because: 1) multidimensional access in C# is a bit slower than single dimensional 2) Array indexing is slower than pointer arithmetic 3) The .NET classes are a thin layer on top of the unmanaged GDI+ functions. If you can't change that, then you'd have to copy from the unmanaged world to the managed world and back, which would be really slow. #3 is a design decision which I hope can be addressed in the future. I'm not sure what we'd do to address the others. Thanks for the info; I'll take a look at the code.
Eric Gunnerson (msft) wrote: Did the C++ version use pointer arithmetic, or did it use array indexing? Pointers, for speed. I appreciate all that you are saying, my point is more that C# should be able to access the bitmap data in one call, instead of using get/setpixel which is notoriously slow, and without having to write code that will be marked 'unsafe'. Ideally, I guess that means GDI+ should provide another call, or C# should sandbox the GetData call and return the data. This will be slower, of course, but I would not mind that if I had the option to go unsafe, but could do pixel access in some way that was as optimised as I could hope for without marking my code as unsafe. Christian come on all you MS suckups, defend your sugar-daddy now. - Chris Losinger - 11/07/2002
-
Sorry that the last one came across as anonymous. Not sure why... Christian Graus wrote: The obvious option is a function that returns the bitmap as a 2D array. How do you think every array in memory is laid out ? There is no reason to regard it as unsafe to access the member data of the Bitmap class. Hmm. Did the C++ version use pointer arithmetic, or did it use array indexing? I agree that you can return a 2D array, but I don't that would help much in this case because: 1) multidimensional access in C# is a bit slower than single dimensional 2) Array indexing is slower than pointer arithmetic 3) The .NET classes are a thin layer on top of the unmanaged GDI+ functions. If you can't change that, then you'd have to copy from the unmanaged world to the managed world and back, which would be really slow. #3 is a design decision which I hope can be addressed in the future. I'm not sure what we'd do to address the others. Thanks for the info; I'll take a look at the code.
I looked at the code, and it pretty much looks like my code. Is there anyplace I can look at the equivalent C++ code that Chris timed?