ExternalInterface is the API provided by Flash to communicate with its hosting environment. For my case, it is the browsers hosting the Flash “movie”. I noticed different performance behavior on each browser. This is my attempt to measure performance penalty caused by each browser.

Here’s the software versions:

Flash plugin version: 10,0,32,18

Chrome 4.1.249
Firefox 3.6.3
IE 8.0

How did I measure

1. I call Been.FComm.send() function in Javascript and timestamp (Tjs1) it. This JS function calls the send() in the Flash.

2. In the Flash application I timestamp (Tf1) send() function call.

3. In the Flash application I also timestamp (Tf2) handleData() and call been_fcomm_handle JS function.

4. Then I timestamp (Tjs2) been_fcomm_handle() in Javascript.

Flash application is written in Flex. It sends a data over a TCP socket and reads the response back. As all functions, send() and handleData() functions in my application also has a debug() call — which includes a timestamp.

Here’s how I implemented measurement in Flash:

So that I can measure how long Flash thinks it takes my server to give a response.

On the other hand, I also measure the timings in JS layer. Here’s the related code pieces — simplified to death to only contain relevant codes.

Here’s how I implemented measurement in Javascript:

Results

Here are the results samples.

Summary

Browser Flash – JS communication overhead (ms)
Chrome 152.7
IE 1.3
FF 1.6

It looks like Chrome suffers from the most significant overhead, while IE and FF could be considered on a par.