Dave said:
I'm just trying to figure out how to write the fastest program possible for
a research project which will include artifical intelligence and quantum
physics calculations. Its going to simulate chemical reactions on the
screen and in the mean time I plan to make it able to find easier ways to
calculate the same things because some of the calculations that it will do
will be redundant. that's what the artificial intelligence is for. but the
point is that the program will be hopelessly time consuming if it was fully
functional. In fact, it could take days if not longer to simulate something!
If you can suggest a good way to easily build a program that integrates
windows forms, directx graphics, and very fast code PLEASE PLEASE PLEASE
tell me. C# is just so easy to work with because it is visual but I also
know how to program in C and am only barely familiar with assembly.
thanks
dave
If you need blazing code, I'd suggest building a C\C++ library that does it
and talks to the winforms host via a chunky call. Unfortunatly there are
some issues with managed code that may cause performance degredation in
situations like yours(I'm not saying the performance will be bad, just that
you can probably do better).
Without knowing the specifics of your app, I assume you perform calculations
over some particular set of data and that the simulation processing is the
major chunk of code, not the display or data loading. In that case, I'd
write, to whatever level you need in C in a way that performs as much work
per call as possible and then interface with that in C# to perform the UI
work.
Basically, look into PInvoke(DllImportAttribute()) and see if that will suit
your needs. If it will, import the function calls you need(I'd suggest as
few as possible), and run it on a seperate thread, stoping occasionally to
issue information to the UI and restart processing.
Also, you may want to look into intel's C++ compiler, I've used it a time or
two on CRC and MD5 hashing code and seen perceptible performance increases,
it may be of value...or it may not, I don't know.