Saturday, January 11, 2003

Optimizing KDE Applications

There are two sides to optimizing KDE. On the user side there are many advanced tweaks that can be made to the system to make it run faster. These tips range from making sure you are running the final release binaries that don't contain debug symbols, to turning off unneeded graphics. If you are looking for those types of hints go here. The other side of enhancing KDE applications is up to developers. This encompasses speeding up an overall application feel, reducing its binary size, and speeding up the application start. Optimization doesn't always mean tuning a function to run faster, but also encompasses the "feel" of the application. Making the entire application runs as smooth as possible. This article won't give you specific tips or examples, but it should point you in the right direction on where to find the information that will.

Application Design

An application that is poorly designed will gain more out of re-design than performing small tweaks and improvements. Optimization should not be the last step, but should be built into the design when choices such as the algorithms and data structures are decided. Note that actually optimizing chunks of code *should* be last and done by profiling. An excellent book that covers this topic in depth is Code Complete: A Practical Handbook of Software Construction by Steve C McConnell.

Utilizing Existing Classes

Often times developers will write their own classes when in fact, one already existed that they simply did not know about. You should be familiar with the toolkits and the classes in them. Take some time exploring the toolkits documentation to fully find out what it has. You don't need to know all of the details of every class. Simply know what exists so when you need something you wont re-implement it yourself by accident. Classes that are included in the toolkits are generally optimized and bug free because many developers have looked at them.

KDE Documentation:

QT Documentation:

Optimizing C++ Code

Just like software design, C++ optimization is far beyond the scope of this article. Here are a few books that have been specificlly written about how to optimize C++ code.

C++ Footprint and Performance Optimization by Rene Alexander and Graham Bensley

Efficient C++: Performance Programming Techniques by Dov Bulka and David Mayhew

More Effective C++: 35 New Ways to Improve Your Programs and Designs by Scott Meyers

The Association of C & C++ users has a comprehensive listing of computer science books along with reviews.

Doing a search on Google will also bring up some sites that have been created about optimizing C++. Here are a few of them: 1, 2, 3, 4, 7, 8. Although some good information can be attained from these sites, getting a comprehensive book is still recommended, as it will cover a magnitude more. If you have a book or site that you would like to recommend, drop me a line and I will add it. Last but not least check out KCachegrind, which can be used to profile an application and find problem areas that should be improved.


Remember that in almost all cases where GUI applications are involved, you shouldn't go overboard in trying to improve functions. Doing so can complicate the functions to the point where they become difficult to maintain. Application designs should be clean rather than fast.

Popular Posts