Sign in to follow this  

Optimising my program...

This topic is 4714 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello. I have finally completed my program which is basically a 2d user interface type program which uses Direct3d and DirectShow. I think I have optimised the DirectX parts as much as possible for now so I was wondering what I could do to take it a bit further. I want to know if there are any tools which will identify slow parts in my executable so that I can target my optimising more efficiently. Preferably free!! I have been through making a few changes but I have 30+ sizeable cpp files so this approach will take too long, plus I don't even know if the parts that I am streamlining are actually having any affect on the overall speed of the program. Also any links to general optimisation techniques would be greatly appreciated. Kind regards. Mark Coleman

Share this post


Link to post
Share on other sites
A tool called a "profiler" allows you to view performance information of the various areas of your program during execution, allowing you to identify what would benefit the most from optimisation. There have been a lot of topics on these forums about profiler recommendations, so do a few searches and you should be able to find the names of a lot of free profilers you can try.

Share this post


Link to post
Share on other sites
You should try to use a profiler. VTunes and DevPartner Profiler Community Edition are among the best. VTune is not free but you can download a limited version. DevPartner Profiler is free - I didn't test it, and therefore I cannot give you any advice about it.

Using a profiler will enable you to easily find your code bottlenecks. Once you'll have found them, you'll be able to efficiently optimize your code.

HTH,

Share this post


Link to post
Share on other sites
Thanks for your responses everyone. I will look into profilers straight away. I think I might not write my own profiler code for now daerid but thanks for the suggestion. Nemesis2k2, I would normally head straight for the search but it is currently broken!!

Again, a big thankyou. Hopefully I will have a super fast application in no time!

If any of you guys have any general C++ optimisation techniques or links, they would be greatly appreciated so that once I find the slow code, I'll know exactly what to do with it to make it faster!

Kind regards.

Mark Coleman

Share this post


Link to post
Share on other sites
Just a question/comment:

if you are using an optimising compiler, especially VS 2003 .NET, then isn't small optimizing tricks useless, as the compiler would have done that anyway?

tip one: study algorithms, and see if there is a general case that fits your problem. It helps big time, since people have been studying these for years, whilst yours is only a few months old.

tip two: study data structures. Sometime you can be using STL, which is super optimized, and closely integrated with many compilers, so they know tricks with them.

tip three: use vector.reserve when using vector. Most descent compilers will make it so that it is just as fast as an array.

Share this post


Link to post
Share on other sites
Sagar_Indurkhya, Thanks for your comments. I have been looking through my code and I will definately look into vector.reserve. Also due to the inheritance a lot of function calls are being made for no reason, I think I will implement some sort of flag system to more speedily identify objects in the system, thus reducing redundant calls in my system, epecially expensive ones to the API.

Thanks again.

Mark Coleman

Share this post


Link to post
Share on other sites

This topic is 4714 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this