10.4: A programmatic fix for an Exposé slowdown

Jul 06, '05 09:23:00AM

Contributed by: aether

Tiger only hintThere's been some discussion on Mac forums about an Exposé slowdown in 10.4. The slowdown is allegedly due to the new feature introduced in Tiger called Automated Beam Synchronization. Using Quartz Debug from Developer Tools it is possible to temporarily disable Beam Sync.

If you're interested in more permanently disabling Beam Sync, read on...

This thread at CocoaBuilder.com demonstrates code for programmatic disabling of Beam Sync:


extern void CGSSetDebugOptions(int);
extern void CGSDeferredUpdates(int);

typedef enum {
  disableBeamSync = 0,
  automaticBeamSync = 1,
  forcedBeamSyncMode = 2
} beamSyncMode;

beamSyncOption mode = disableBeamSync;

CGSSetDebugOptions(mode ? 0 : 0x08000000);
CGSDeferredUpdates(mode);
It needs to be linked against QuartzCore. If you rather not deal with coding, you can use a simple command line tool called beamsync. Running beamsync with the -d option disables; -a makes automatic, and -f forces beam synchronization. The source code is available as well. Note that both the tool and the code rely on the undocumented API, which is a subject to change in the future Tiger upgrades. It's provided as is; use at your own risk.

Here's a simple method to see if disabling beam sync increases the fps on your system:
  1. Follow the steps in the original hint to run Quartz Debug, but don't disable beam sync right away.
  2. From the Tools menu, enable Frame Meter.
  3. Grab any window on the screen (the Quartz Debug window will do) and "shake" it with a mouse. You'll see the FPS meter go up. On my laptop with Beam Sync enabled, it only goes up to 35 fps.
  4. Now disable Beam Sync and repeat the shaking. The fps should now be around 60! Amazing
[robg adds: With the original hint, I noted that I hadn't seen any slowdown. But using the above method, it's clear that the FPS is capped at 35 when beam sync is enabled. I installed the beamsync app and have set it to disabled, and now the FPS is floating closer to 60.]

Comments (10)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20050622224239730