Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Optimization c++ code

Posted on 2002-03-08
5
Medium Priority
?
222 Views
Last Modified: 2006-11-17
I'm looking for information, tools and software about How to optimize code using intel processor and C++.
0
Comment
Question by:i32tomar
  • 3
5 Comments
 
LVL 11

Expert Comment

by:griessh
ID: 6850504
Turn on the optimization of your C++ compiler ...

======
Werner
0
 
LVL 11

Expert Comment

by:griessh
ID: 6850523
I think you have to explain first WHAT you want to optimize. You can optimize memory usage (usually means slower execution), execution time, access time to external ressources. Most modern compilers are using better optimization that you can hand-code. If you want to optimize the app even more, spend more time on the design of your data flow, the type of objects and the libraries you want to use.

Depending on your OS you will be able to use performance tools to find bottlenecks in your code.

======
Werner
0
 
LVL 16

Accepted Solution

by:
imladris earned 20 total points
ID: 6850725
In general far too much time is spent trying to optimize "code". The best approach is to proceed to completion of the project, whatever it is. Then, if optimization is needed or desired, you start by profiling the code. In terms of speed, a computer normally spends 80% of its time executing 20% of the code. With the profiler you can identify the bottlenecks, and then spend optimization effort where it is going to have some noticeable benefit.
0
 
LVL 3

Expert Comment

by:jtm111
ID: 6851103
To these comments I would add that using solid programming constructs is a good route to fast and clean code. A good programmer could write faster code in Visual Basic than a less effective programmer writing a C++ program with full optimization if the VB programmer used a smarter approach.

You will find there are dozens of areas where you could look to improve your code. Use of inlining, dynamic memory allocation, exception handling, passing arguments by reference, etc.

A widely acknowledged book on good programming practices for intermediate-advanced programming is Scott Myers: Effective C++.

0
 
LVL 11

Expert Comment

by:griessh
ID: 6955310
Dear i32tomar

I think you forgot this question. I will ask Community Support to close it unless you finalize it within 7 days. You can always request to keep this question open. But remember, experts can only help you if you provide feedback to their questions.
Unless there is objection or further activity,  I will suggest to accept

     "griessh"

comment(s) as an answer.

If you think your question was not answered at all, you can post a request in Community support (please include this link) to refund your points. The link to the Community Support area is: http://www.experts-exchange.com/commspt/

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
======
Werner
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

885 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question