Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Optimization c++ code

Posted on 2002-03-08
5
Medium Priority
?
220 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

722 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