Hi everyone!!

I have a scientific C++ program which requires a good speed to run.(the program runs a lot of matrix and vector operations)

For doing that, I come across following options on the net:

1. Use of turbo C++
2. Use of Linux instead of window XP

My current system uses Dev C++ over Window XP.

Can I expect some speed increase using above options?
If so, would it be significant?


Thanks

Not really. Sounds like your problem is you need to be utilizing a nice fast SIMD based math library.

Rule 1) Make sure your code is absolutely 16 byte aligned.
Rule 2) If you have a 3 element vector change it to 4 and make the 4the a dummy ignore it as it has trash field.

Once you do that then start looking for libraries. Or my favorite, build them yourself. That's where my bread and butter comes from and I have an opening in my schedule coming up! (But I digress!) Follow rule 1 and rule 2, then find a math library. You can always cast your data types to match theirs or cast on the fly!

There's an out of print book that is very good on this subject. "Vector Game Math Processors" by James Leiterman. You can still get new and used versions from Amazon and I think its well worth the price when it was full priced. (Now its discounted!)

I forgot Rule 0) Go into your project settings and make sure to change "DEFAULT" to 16 byte alignment in Release, Debug, and any other configuration build types.

> Can I expect some speed increase using above options?
You can certainly expect a change, so you might consider that some of them would be quicker.
But saying which would be quicker in advance would be pure guess-work.

> If so, would it be significant?
Doubtful.
+/- 10% between the best and the worst would be an average.

Again, you might find compiler 'x' on OS 'y' to be particularly good, but you would only find it by accident rather than some predictable information in advance.

All compilers fundamentally implement the same algorithm (your code). Each in their own way is going to generate the code to do pretty much the same amount of work, which will take pretty much the same amount of time.

If you want to turn an hour into a minute, then you need a change of algorithm, not a change of compiler.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.