Apple may be boosting Safari speeds with a series of hidden and undocumented API's in OS X that other browsers can't access, a Firefox developer explained last night.

Leading Firefox developer Vladimir Vukicevic explains his discoveries on his blog, which is available here.

He points out that Firefox 3 betas have become more responsive on Mac OS X than they were a few weeks ago, and notes previous complaints in which users had seen poorer performance on OS X than found using Firefox 2.

"Firefox3 was coming in at 50 per cent to 500 per cent+ slower.  This was odd, because in theory the graphics layer (which is what scrolling is mostly exercising) in Firefox 3 should be faster, given that it's talking almost directly to Quartz," he writes.

The developer began exploring Apple's WebKit engine for Safari and came across 100 undocumented APIs Safari can call on for better browsing, but Firefox cannot.

Reading the WebKit code is pretty interesting; there are all sorts of potentially useful Cocoa internals bits you can pick up, more easily on the Objective C side (e.g. search for "AppKitSecretsIKnow" in the code), but also in other areas as a pile of these methods used in quite a few places. 

"Would any other apps like to take advantage of some of that functionality?  I'm pretty sure the answer there is yes, but they can't," he notes.

The developer continued: "We're being throttled by the OS which is forcing us to wait for the next frame interval before allowing us to draw again.  This is a pretty serious problem, because at this point I thought that the only way to disable this was on a system-wide basis, which wouldn't be acceptable.  Firefox 2 didn't suffer from this, though, so I did some more digging."

The developer doesn't believe Apple is deliberately throttling Firefox speed with these undisclosed APIs, though: "I don't think this is malicious, it's just an unfortunate cutting of corners that is way too easy for a company that's not fully open to do."

Apple's WebKit developer David Hyatt says that it would have been dangerous to make the APIs public: "We aren't really happy with that code in WebKit, but we had to do it to avoid performance regressions in apps that embedded WebKit," he said.