c# performance

P

phoenix

Daedelus said:
hi, What is the performance hit of c# over visual c++. Would it be possible
to write photoshop in c# for example with no noticable speed loss?

thanks.

If you would work with getpixel and setpixel functions only it would be
really slow, but using unsafe code can make imageprocessing pretty fast.

There is a basic article on using unsafe code on images on msdn :
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dncscol/html/csharp11152001.asp

On codeproject there are some good articles about image processing (it's not
a full blown photoshop but it got some interesting functions) :
http://www.codeproject.com/cs/media/csharpgraphicfilters11.asp
http://www.codeproject.com/cs/media/csharpfilters.asp
http://www.codeproject.com/cs/media/edge_detection.asp
http://www.codeproject.com/cs/media/imageprocessing4.asp
http://www.codeproject.com/cs/media/displacementfilters.asp
http://www.codeproject.com/cs/media/HSLColorSpace.asp

Yves
 
D

Daedelus

hi, What is the performance hit of c# over visual c++. Would it be possible
to write photoshop in c# for example with no noticable speed loss?

thanks.
 
N

Niki Estner

Daedelus said:
hi, What is the performance hit of c# over visual c++. Would it be possible
to write photoshop in c# for example with no noticable speed loss?

To my knowledge, noone did ever implement something like photoshop in c#;
However, the speed-relevant parts of it are (I think) more or less simple
calculations over huge arrays (applying filters, transformations, etc). In
my experience C# and C++ are about comparable in that respect, sometimes C#
is even a bit faster (after all, it gets compiled to native code, too).

Niki
 
G

Guest

I wouldn't be surprised if the code in photoshop for applying filters is
actually handcoded assembly. Maybe not.

Still, C# could definitely handle something like photoshop without a
noticeable speed loss. There are plenty of programs that perform similar
manipulations of images that photoshop does and I haven't noticed any speed
issues with them. None of them are equivalents of photoshop in terms of
total functionality, but they might support a subset of the functionality.

Pete
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top