Efficient way of processing large data with Javascript in the browser
<p>I use a third-party flash component (wrapped with Javascript) with my web application, from which I get comma-separated values and base64 data from it:</p>

<p>Get csv string as array function:</p>

<pre><code>// Get the csv as array function
var buff = $wnd.MyFlashComp.getData();
var strBuff = buff.toString();
var arr = strBuff.split(',');
</code></pre>

<p>Get base64 data function:</p>

<pre><code>// Get the data as base64 function
var buff64 = $wnd.MyFlashComp.getData64();
</code></pre>

<p>When I use buff64 and plug it in a HTML tag as base64 <code>src</code> data, the data is rendered properly in the browser, that is the page is still snappy. And I don't see any performance issue with the page.</p>

<p>However, the function that gets the csv as array is very slow, and makes the page hang if not lag. The data I'm getting from flash range from 500KB to 1MB in size (max).</p>

<p>Is there a way to improve performance of this code?</p>
