Solved

Optimization c++ code

Posted on 2002-03-08
5
214 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 10 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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

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…
This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

708 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now