Design question for fast applications
-
Hello, we have to make applications which has to make very computationally intensive operations. For that in the past we have used C . in the last year I have tested c# with the result that it was to slow. But the possibilities to make forms and so on was great. for that we have decided to use c++ and for the graphical environment .net. In this case the best solutions seems to use c++/cli. But with that we have a lot of problems. It is impossible to make dlls, which have parts in c++ und .net. (problems exporting the classes and so on...). a lot of people has the same problems. another problem is that CLI is not implemented well in Visual studio (slow,a lot of errors in the designer...). Now we search for possibility to design an application which has booth advantages. Easy to make the visual part and fast for the whole computations. Is there any easy way to communicate between 2 (maybe) programs, exchange data which is needed in the other part, it is fast (espacially for the computation part) and so on? Best regards Hansjörg
-
Hello, we have to make applications which has to make very computationally intensive operations. For that in the past we have used C . in the last year I have tested c# with the result that it was to slow. But the possibilities to make forms and so on was great. for that we have decided to use c++ and for the graphical environment .net. In this case the best solutions seems to use c++/cli. But with that we have a lot of problems. It is impossible to make dlls, which have parts in c++ und .net. (problems exporting the classes and so on...). a lot of people has the same problems. another problem is that CLI is not implemented well in Visual studio (slow,a lot of errors in the designer...). Now we search for possibility to design an application which has booth advantages. Easy to make the visual part and fast for the whole computations. Is there any easy way to communicate between 2 (maybe) programs, exchange data which is needed in the other part, it is fast (espacially for the computation part) and so on? Best regards Hansjörg
Hi Hansjörg, I'm not sure what computationally intensive operations you are attempting to perform but there are a number of ways of improving the performance of your application and it all depends on the specifics of what you are doing as to the best way of breaking it down. I struggled for performance on my final year project (which was analysing webcam pictures in real time). I considered the possibility of writing the core in C++ and calling a library but in the end I decided I couldn't be bothered to do that and simply used an unsafe { } block within C# to give me my pointers back so I could analyse the bitmap at the byte data level. That worked fantastically to give me the performance I needed (it might even have been better than calling a dll library function since I wasn't consistantly making external library calls). Other options are adding threading to your app, using a C++ service running on the same machine and communicating with that over remoting calls (this is not a particularl safe or uncomplex option, but if you really don't want to use dlls it could be a work around). I'm assuming your interface will already be on a seperate thread in the .Net app so it doesn't freeze and you can do you computation in the background but let us all know if that isn't the case as it may affect your outlook on the whole thing. Best Regards, Adam
-
Hi Hansjörg, I'm not sure what computationally intensive operations you are attempting to perform but there are a number of ways of improving the performance of your application and it all depends on the specifics of what you are doing as to the best way of breaking it down. I struggled for performance on my final year project (which was analysing webcam pictures in real time). I considered the possibility of writing the core in C++ and calling a library but in the end I decided I couldn't be bothered to do that and simply used an unsafe { } block within C# to give me my pointers back so I could analyse the bitmap at the byte data level. That worked fantastically to give me the performance I needed (it might even have been better than calling a dll library function since I wasn't consistantly making external library calls). Other options are adding threading to your app, using a C++ service running on the same machine and communicating with that over remoting calls (this is not a particularl safe or uncomplex option, but if you really don't want to use dlls it could be a work around). I'm assuming your interface will already be on a seperate thread in the .Net app so it doesn't freeze and you can do you computation in the background but let us all know if that isn't the case as it may affect your outlook on the whole thing. Best Regards, Adam
Hi Adam, we have also a lot of image processing (we have every second about 3 high resolution pictures) and some other task which control the production in a plant. all this operation have to be "fast". If we don't use the #pragma managed(push, off) our calculations needs about 100% more time to finish. Dll's would be also possible to use. But here we have a lot of problems to make the dlls working, because we want to include inside not only unmanaged stuff but also some visualisation which applies to this optimizations (settings...). Best regards Hansjörg
-
Hello, we have to make applications which has to make very computationally intensive operations. For that in the past we have used C . in the last year I have tested c# with the result that it was to slow. But the possibilities to make forms and so on was great. for that we have decided to use c++ and for the graphical environment .net. In this case the best solutions seems to use c++/cli. But with that we have a lot of problems. It is impossible to make dlls, which have parts in c++ und .net. (problems exporting the classes and so on...). a lot of people has the same problems. another problem is that CLI is not implemented well in Visual studio (slow,a lot of errors in the designer...). Now we search for possibility to design an application which has booth advantages. Easy to make the visual part and fast for the whole computations. Is there any easy way to communicate between 2 (maybe) programs, exchange data which is needed in the other part, it is fast (espacially for the computation part) and so on? Best regards Hansjörg
hansipet wrote:
It is impossible to make dlls, which have parts in c++ und .net. (problems exporting the classes and so on...).
I don't know what that means but I have not had a problem creating the following: (1) C++/CLI DLL (mixed mode) that exports native C++ classes that are consumed by a native C++ application. Exported native classes use managed code to perform some work and then marshal results back to native memory consumed at the native application layer. (2) C++/CLI (mixed mode) assembly that publishes public managed classes that are consumed by .NET managed applications. Managed classes that use mixed mode to perform operations by using Native C++ classes and marshal the native results to managed memory for return to the managed application layer. If you are trying to do anything else I would need an explanation to understand what that is.
led mike