I understand, how the compositing windows managers interfere with overall gaming performance, including vsync, as games (all other apps) get rendered indirectly.
Basically, every window is redirected to an offscreen buffer, and the composite manager draws them 'manually' onto the root window (e.g. including shadows and other visual effects).

KWin and Compiz offer the possibility to disable the composition for fullscreen root windows, which works ok (except for e.g. multi monitor setups or non-fullscreen games).

Wouldn't it make sense, to generally disable composition for the foremost/focused window (as long as it's not transparent), and just draw all other windows, as well as the shadows (including the shadow of the foremost window) to the root window image?

That should (imho) work for all games/apps, and the framerate/vsync won't depend on the compositing window manage anymore. Or do i miss anything?