KWin, the standard KDE window manager in KDE4.0, ships with the first version of built-in support for compositing, making it also to compositing manager. This allows KWin to provide advanced graphical effects, similar to Compiz, while also providing all the features from previous KDE releases. Unlike Compiz, KWin still functions even when not system support for compositing is available, with only the compositing features being unavailable. KWin in KDE4.0 is also relatively new tails and has not been extensively optimized yet, therefore its performance may not be in loads areas comparable with performance of other compositing managers. In such cases performance should be improved with newer versions.Smoothness of KWin rendering can be improved by setting the env.variable KWIN_NVIDIA_HACK to 1. This sets ‘ _ _ GL_YIELD=NOTHING’ for KWin, letting KWin use more CPU Time for OpenGL operations, however at the expense of affecting performance of other applications. Therefore, this is disabled by default. This setting may be removed in the future if the negative impact becomes insignificant.
Open ~/.profile file and the following line:
export KWIN_NVIDIA_HACK=1
For more on this check COMPOSITE_HOWTO. Now see the difference.
Tip: In loads cases, overall smoothness may be increased by turning off direct rendering in advanced options in the Desktop Effects configuration module (Alt+F3->Configure Window Behavior).
No optimastion or tweaks for ATI video cards that I have noticed so far. If you know, let us know.