<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" 
      xmlns:thr="http://purl.org/syndication/thread/1.0">
  <link rel="alternate" type="text/html" href="http://www.insideria.com/2008/08/i-accept-the-one-million-recor.html" />
  <link rel="self" type="application/atom+xml" href="http://www.insideria.com/atom.xml" />
  <id>tag:www.insideria.com,2009://34/tag:www.insideria.com,2008://34.26345-</id>
  <updated>2009-11-05T20:01:24Z</updated>
  <title>Comments for I Accept the &quot;One Million Records&quot; Challenge (http://www.insideria.com/2008/08/i-accept-the-one-million-recor.html)</title>
  <generator uri="http://www.sixapart.com/movabletype/">Movable Type 4.21-en</generator>
  <entry>
    <id>tag:www.insideria.com,2008://34.26345</id>
    <link rel="alternate" type="text/html" href="http://www.insideria.com/2008/08/i-accept-the-one-million-recor.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://blogs.oreilly.com/cgi-bin/mt/mt-atom.cgi/weblog/blog_id=34/entry_id=26345" title="I Accept the &quot;One Million Records&quot; Challenge" />
    <published>2008-08-08T01:50:54Z</published>
    <updated>2008-08-08T03:00:08Z</updated>
    <title>I Accept the &quot;One Million Records&quot; Challenge</title>
    <summary>Earlier today, Richard Monson-Haefel posted here on insideria.com about the &quot;One Million Record Challenge&quot;.   I thought this was a pretty interesting test for any RIA platform, although it will yield wildly different results on different machines, and can&apos;t necessarily be used as a true benchmark.   I decided to take on this challenge with Flex.</summary>
    <author>
      <name>Andrew Trice</name>
      
    </author>
    
    <category term="Blogs" />
    
    <content type="html" xml:lang="en" xml:base="http://www.insideria.com/">
      <![CDATA[Earlier today, Richard Monson-Haefel posted here on insideria.com about the "<a tqarget="_blank" href="http://www.insideria.com/2008/08/the-one-million-records-challe.html">One Million Record Challenge</a>".   I thought this was a pretty interesting test for any RIA platform, although it will yield wildly different results on different machines, and can't necessarily be used as a true benchmark.   <br/><br/>

I decided to take on this challenge with Flex.  I used Richard's <a target="_blank" href="http://www.monson-haefel.com/insideria/ContactGenerator.java">java </a>program to generate 3 files.  One with 10,000 records, one with 100,000 records, and one with 1,000,000 records.     In my opinion, Flex/Flash passed the test.  Here's what I found on my machine (Windows XP, Intel Core 2 Duo @ 2 GHz, 2 Gigs of RAM) when loading the data off of the local file system.<br/><br/>


<table bordercolor="#999999" border="1"><th>Records&nbsp;&nbsp;</th><th>Load&nbsp;Time&nbsp;&nbsp;</th><th>Parse&nbsp;Time&nbsp;&nbsp;</th><th>Total Time&nbsp;&nbsp;</th><th>Column Sort&nbsp;&nbsp;</th><tr><td>10,000</td><td>114ms</td><td>101ms</td><td>215ms</td><td>&lt; 1 sec</td><tr><tr><td>100,000</td><td>278ms</td><td>447ms</td><td>725ms</td><td>~ 1 sec</td><tr><tr><td>1,000,000</td><td>1749ms</td><td>7550ms</td><td>9299ms</td><td>~ 5-6 secs</td><tr></table>
<br/>
The data files themselves were actually pretty big.   Hence, In my example below, I only have the 10,000 and 100,000 data files.  Here are the generated file sizes:
<Br/><Br/>
<table border="1" bordercolor="#999999"><th>Records&nbsp;&nbsp;</th><th>File&nbsp;Size</th><tr><td>10,000</td><td>909K </td><tr><tr><td>100,000</td><td>9,083K</td><tr><tr><td>1,000,000</td><td>90, 821K </td><tr></table>
<br/>

Here's the example online.  Just select a source file and click on the "load data" button.  Give it a few minutes to load the data (it's pretty big).  <br/><br/>
<iframe 
src="http://www.tricedesigns.com/portfolio/million/LargeData.html"
width="425" height="300" frameborder="0">
</iframe><br/><br/>

And now, the source code...   <br/><br/>There are a few tricks to making this work.   The code uses a HTTPService to return the csv data file.   Since it is csv, you have to parse it yourself.  Be sure to set the resultFormat of the HTTPService to "text" so that Flex doesn't automatically try to parse the data for you.  I had the 1 million record file crash my browser until I set the resultFormat option.<br/><br/>
Next, since this is only for reading large quantities of data, I decided not to use any bindings.   I used plain-old arrays instead of ArrayCollections to keep it simple and fast.   
<br/><br/>
Next, just parse the data, and shove it into the default Flex mx:DataGrid object.   The DataGrid component only renders what is actually visible on the screen, so it is very fast.  All of the sorting is using the default sort logic.
<br/><br/>
You can check out the full source here:<br/>

<div class="acode" style="overflow: auto; padding: 10px; font-size:10pt;" ><div style="overflow-x: visible;">
<code language="perl">
<pre>&lt;?xml <span class="category2">version</span>="<span class="quote">1.0</span>" encoding="<span class="quote">utf-8</span>"?&gt;
&lt;mx:<span class="category2">Application</span> xmlns:mx="<span class="quote">http://www.adobe.com/2006/mxml</span>" layout="<span class="quote">absolute</span>" viewSourceURL="<span class="quote">srcview/index.html</span>"&gt;

  &lt;mx:Script&gt;
    &lt;![CDATA[
      <span class="category1">import</span> flash.utils.<span class="category1">getTimer</span>;
      <span class="category1">import</span> mx.collections.ArrayCollection;
      <span class="category1">import</span> mx.utils.StringUtil;
      <span class="category1">import</span> mx.rpc.events.FaultEvent;
      <span class="category1">import</span> mx.rpc.events.ResultEvent;
      
      <span class="category1">private</span> <span class="category1">var</span> initialTime : <span class="category1">int</span>;
      <span class="category1">private</span> <span class="category1">var</span> loadComplete : <span class="category1">int</span>;
      
      <span class="category1">private</span> <span class="category1">function</span> loadData() : <span class="category1">void</span>
      {
         initialTime = <span class="category1">getTimer</span>();
         httpService.<span class="category2">url</span> = source.<span class="category2">text</span>;
         httpService.<span class="category2">send</span>();
         loadButton.<span class="category2">enabled</span> = <span class="category1">false</span>;
       }
      
      <span class="category1">private</span> <span class="category1">function</span> onResult( event : ResultEvent ) : <span class="category1">void</span>
      {  
         loadComplete = <span class="category1">getTimer</span>();
         <span class="category1">var</span> result : <span class="category2">Array</span> = [];
         <span class="category1">var</span> arr : <span class="category2">Array</span> = event.result.<span class="category2">toString</span>().<span class="category2">split</span>( "<span class="quote">\n</span>" );
         
          <span class="category1">for</span> each ( <span class="category1">var</span> str : <span class="category2">String</span> <span class="category1">in</span> arr )
         {
            result.<span class="category2">push</span>( str.<span class="category2">split</span>( "<span class="quote">, </span>" ) );
          } 
         dg.dataProvider = result;
         loadButton.<span class="category2">enabled</span> = <span class="category1">true</span>;
         resultText.<span class="category2">text</span> = "<span class="quote">data loaded in </span>" + (loadComplete - initialTime) + "<span class="quote">ms, data parsed in </span>" + (<span class="category1">getTimer</span>() - loadComplete) + "<span class="quote">ms, total </span>" + (<span class="category1">getTimer</span>() - initialTime);
       }
      
      <span class="category1">private</span> <span class="category1">function</span> onFault( event : FaultEvent ) : <span class="category1">void</span>
      {
         loadButton.<span class="category2">enabled</span> = <span class="category1">true</span>;
       }
    ]]&gt;
  &lt;/mx:Script&gt;
  
  &lt;mx:HTTPService 
    id="<span class="quote">httpService</span>" 
    result="<span class="quote">onResult(event)</span>" 
    fault="<span class="quote">onFault(event)</span>" 
    resultFormat="<span class="quote">text</span>"/&gt;
  
  &lt;mx:ApplicationControlBar dock="<span class="quote">true</span>"&gt;
    
    &lt;mx:ComboBox id="<span class="quote">source</span>"&gt;
      &lt;mx:dataProvider&gt;
        &lt;mx:<span class="category2">Array</span>&gt;
          &lt;mx:<span class="category2">String</span>&gt;assets/10_thousand.csv&lt;/mx:<span class="category2">String</span>&gt;
          &lt;mx:<span class="category2">String</span>&gt;assets/100_thousand.csv&lt;/mx:<span class="category2">String</span>&gt;
          &lt;!--&lt;mx:<span class="category2">String</span>&gt;assets/1_million.csv&lt;/mx:<span class="category2">String</span>&gt;--&gt;
        &lt;/mx:<span class="category2">Array</span>&gt;
      &lt;/mx:dataProvider&gt;
    &lt;/mx:ComboBox&gt;
    
    &lt;mx:<span class="category2">Button</span> <span class="category1">label</span>="<span class="quote">Load Data</span>" click="<span class="quote">loadData()</span>" id="<span class="quote">loadButton</span>" /&gt;
    
    &lt;mx:Text <span class="category2">text</span>="<span class="quote"></span>" id="<span class="quote">resultText</span>" /&gt;
  
  &lt;/mx:ApplicationControlBar&gt;
  
  &lt;mx:DataGrid id="<span class="quote">dg</span>" bottom="<span class="quote">10</span>" top="<span class="quote">10</span>" left="<span class="quote">10</span>" right="<span class="quote">10</span>"&gt;
    &lt;mx:columns&gt;
      &lt;mx:DataGridColumn dataField="<span class="quote">0</span>" /&gt;
      &lt;mx:DataGridColumn dataField="<span class="quote">1</span>" /&gt;
      &lt;mx:DataGridColumn dataField="<span class="quote">2</span>" /&gt;
      &lt;mx:DataGridColumn dataField="<span class="quote">3</span>" /&gt;
    &lt;/mx:columns&gt;
  &lt;/mx:DataGrid&gt;
  
  
&lt;/mx:<span class="category2">Application</span>&gt;</pre>
</code>

</div></div>


___________________________________
<strong>Andrew Trice</strong>
Principal Architect
<a href="http://www.cynergysystems.com" target="_blank">Cynergy Systems
http://www.cynergysystems.com</a>
]]>
      
    </content>
  </entry>

  <entry>
    <id>tag:www.insideria.com,2008://34.26345-comment:2020465</id>
    <thr:in-reply-to ref="tag:www.insideria.com,2008://34.26345" type="text/html" href="http://www.insideria.com/2008/08/i-accept-the-one-million-recor.html"/>
    <link rel="alternate" type="text/html" href="http://www.insideria.com/2008/08/i-accept-the-one-million-recor.html#comment-2020465" />
    <title>Comment from TJ Downes on 2008-08-07</title>
    <author>
        <name>TJ Downes</name>
        <uri>http://www.sanative.net</uri>
    </author>
    <content type="html" xml:lang="en" xml:base="http://www.sanative.net">
        <![CDATA[<p>Andrew, this is excellent. I appreciate that you took the time to do this. It shows that Flex is a robust and very viable platform for doing this type of data manipulation!</p>

<p>We are currently working on a project using CSVLib in flex and have found out just how powerful Flex is for parsing large recordsets on the fly.</p>

<p>By the way, your example took my machine:<br />
data loaded in 3314ms, data parsed in 36ms, total 3350</p>

<p>Thats a dual core 2.4Ghz with 4GB RAM on Vista 64bit</p>]]>
    </content>
    <published>2008-08-08T03:38:53Z</published>
  </entry>

  <entry>
    <id>tag:www.insideria.com,2008://34.26345-comment:2020466</id>
    <thr:in-reply-to ref="tag:www.insideria.com,2008://34.26345" type="text/html" href="http://www.insideria.com/2008/08/i-accept-the-one-million-recor.html"/>
    <link rel="alternate" type="text/html" href="http://www.insideria.com/2008/08/i-accept-the-one-million-recor.html#comment-2020466" />
    <title>Comment from TJ Downes on 2008-08-07</title>
    <author>
        <name>TJ Downes</name>
        <uri>http://www.sanative.net</uri>
    </author>
    <content type="html" xml:lang="en" xml:base="http://www.sanative.net">
        <![CDATA[<p>For 100k records:<br />
data loaded in 39260ms, data parsed in 614ms, total 39874</p>]]>
    </content>
    <published>2008-08-08T03:41:21Z</published>
  </entry>

  <entry>
    <id>tag:www.insideria.com,2008://34.26345-comment:2020470</id>
    <thr:in-reply-to ref="tag:www.insideria.com,2008://34.26345" type="text/html" href="http://www.insideria.com/2008/08/i-accept-the-one-million-recor.html"/>
    <link rel="alternate" type="text/html" href="http://www.insideria.com/2008/08/i-accept-the-one-million-recor.html#comment-2020470" />
    <title>Comment from Raul Riera on 2008-08-07</title>
    <author>
        <name>Raul Riera</name>
        <uri>http://www.hipervinculo.net</uri>
    </author>
    <content type="html" xml:lang="en" xml:base="http://www.hipervinculo.net">
        <![CDATA[<p>data loaded in 45396ms, data parsed in 216ms, total 45612</p>

<p>Mac, Safari Flash Player 10</p>]]>
    </content>
    <published>2008-08-08T06:42:32Z</published>
  </entry>

  <entry>
    <id>tag:www.insideria.com,2008://34.26345-comment:2020471</id>
    <thr:in-reply-to ref="tag:www.insideria.com,2008://34.26345" type="text/html" href="http://www.insideria.com/2008/08/i-accept-the-one-million-recor.html"/>
    <link rel="alternate" type="text/html" href="http://www.insideria.com/2008/08/i-accept-the-one-million-recor.html#comment-2020471" />
    <title>Comment from Raul Riera on 2008-08-07</title>
    <author>
        <name>Raul Riera</name>
        <uri>http://www.hipervinculo.net</uri>
    </author>
    <content type="html" xml:lang="en" xml:base="http://www.hipervinculo.net">
        <![CDATA[<p>That was a Macbook Pro 2.2Ghz 4Gb RAM Mac OSX Leopard and the 100k dataset</p>]]>
    </content>
    <published>2008-08-08T06:44:37Z</published>
  </entry>

  <entry>
    <id>tag:www.insideria.com,2008://34.26345-comment:2020476</id>
    <thr:in-reply-to ref="tag:www.insideria.com,2008://34.26345" type="text/html" href="http://www.insideria.com/2008/08/i-accept-the-one-million-recor.html"/>
    <link rel="alternate" type="text/html" href="http://www.insideria.com/2008/08/i-accept-the-one-million-recor.html#comment-2020476" />
    <title>Comment from Andrew Trice on 2008-08-08</title>
    <author>
        <name>Andrew Trice</name>
        <uri>http://www.tricedesigns.com</uri>
    </author>
    <content type="html" xml:lang="en" xml:base="http://www.tricedesigns.com">
        <![CDATA[<p>Thanks for the feedback Raul and TJ.   As you an see, the majority of the time is spent actually transferring data from the server to the client, not parsing the data.  The Flash player is extremely powerful and fast when parsing this data.   No matter what technology is used, you would have some serious latency loading data this size in a real application.</p>]]>
    </content>
    <published>2008-08-08T12:42:58Z</published>
  </entry>

  <entry>
    <id>tag:www.insideria.com,2008://34.26345-comment:2020479</id>
    <thr:in-reply-to ref="tag:www.insideria.com,2008://34.26345" type="text/html" href="http://www.insideria.com/2008/08/i-accept-the-one-million-recor.html"/>
    <link rel="alternate" type="text/html" href="http://www.insideria.com/2008/08/i-accept-the-one-million-recor.html#comment-2020479" />
    <title>Comment from Tim McLeod on 2008-08-08</title>
    <author>
        <name>Tim McLeod</name>
        <uri>http://www.timmcleod.com</uri>
    </author>
    <content type="html" xml:lang="en" xml:base="http://www.timmcleod.com">
        <![CDATA[<p>After I saw that post the other day, I wondered how long it would take someone to write a Flex version.  :-)  Thanks for the info Andrew.</p>

<p>I would be curious to see the difference in performance when the data is loaded using remoting.  I would think it would be considerably faster.</p>

<p>I'm on an iMac 2.4, 2Gb ram:<br />
data loaded in 14614ms, data parsed in 376ms, total 14990</p>

<p>Tim</p>]]>
    </content>
    <published>2008-08-08T12:56:53Z</published>
  </entry>

  <entry>
    <id>tag:www.insideria.com,2008://34.26345-comment:2020480</id>
    <thr:in-reply-to ref="tag:www.insideria.com,2008://34.26345" type="text/html" href="http://www.insideria.com/2008/08/i-accept-the-one-million-recor.html"/>
    <link rel="alternate" type="text/html" href="http://www.insideria.com/2008/08/i-accept-the-one-million-recor.html#comment-2020480" />
    <title>Comment from Andrew Trice on 2008-08-08</title>
    <author>
        <name>Andrew Trice</name>
        <uri>http://www.tricedesigns.com</uri>
    </author>
    <content type="html" xml:lang="en" xml:base="http://www.tricedesigns.com">
        <![CDATA[<p>Hi Tim,  I'd be curious to see the difference too.   I just decided to stick with what Richard had already done, to have a consistent comparison.</p>]]>
    </content>
    <published>2008-08-08T12:59:06Z</published>
  </entry>

  <entry>
    <id>tag:www.insideria.com,2008://34.26345-comment:2020485</id>
    <thr:in-reply-to ref="tag:www.insideria.com,2008://34.26345" type="text/html" href="http://www.insideria.com/2008/08/i-accept-the-one-million-recor.html"/>
    <link rel="alternate" type="text/html" href="http://www.insideria.com/2008/08/i-accept-the-one-million-recor.html#comment-2020485" />
    <title>Comment from Jasper Potts on 2008-08-08</title>
    <author>
        <name>Jasper Potts</name>
        <uri>http://jasperpotts.com</uri>
    </author>
    <content type="html" xml:lang="en" xml:base="http://jasperpotts.com">
        <![CDATA[<p>I know from the Java world that the hard thing of handling a million rows or more in a data grid is multiple selection. Have you tried this with a large set of randomly selected items, like 10,000 out of your million? and then sorting while maintaining the selection. I did some work on this problem on the Java side and came up with a new selection model that helped some of the cases of huge data sets but was not perfect. I wonder how well Flex handles this. </p>

<p><a href="http://www.jasperpotts.com/blog/2007/11/faster-swing-lists-and-tables-upto-88000x/">http://www.jasperpotts.com/blog/2007/11/faster-swing-lists-and-tables-upto-88000x/</a></p>

<p>Jasper</p>]]>
    </content>
    <published>2008-08-08T14:48:11Z</published>
  </entry>

  <entry>
    <id>tag:www.insideria.com,2008://34.26345-comment:2020488</id>
    <thr:in-reply-to ref="tag:www.insideria.com,2008://34.26345" type="text/html" href="http://www.insideria.com/2008/08/i-accept-the-one-million-recor.html"/>
    <link rel="alternate" type="text/html" href="http://www.insideria.com/2008/08/i-accept-the-one-million-recor.html#comment-2020488" />
    <title>Comment from Andrew Trice on 2008-08-08</title>
    <author>
        <name>Andrew Trice</name>
        <uri>http://www.tricedesigns.com</uri>
    </author>
    <content type="html" xml:lang="en" xml:base="http://www.tricedesigns.com">
        <![CDATA[<p>Good question...   I just threw this together to see if Flex could handle that many records in a table.   I'll have to test it out.   .</p>]]>
    </content>
    <published>2008-08-08T15:02:32Z</published>
  </entry>

  <entry>
    <id>tag:www.insideria.com,2008://34.26345-comment:2020492</id>
    <thr:in-reply-to ref="tag:www.insideria.com,2008://34.26345" type="text/html" href="http://www.insideria.com/2008/08/i-accept-the-one-million-recor.html"/>
    <link rel="alternate" type="text/html" href="http://www.insideria.com/2008/08/i-accept-the-one-million-recor.html#comment-2020492" />
    <title>Comment from TJ Downes on 2008-08-08</title>
    <author>
        <name>TJ Downes</name>
        <uri>http://www.sanative.net</uri>
    </author>
    <content type="html" xml:lang="en" xml:base="http://www.sanative.net">
        <![CDATA[<p>Another thing worth mentioning: When I performed the test I had a significant number of apps open and services running on my machine, including a SIP client, ColdFusion, a web server, Pandora, MS Outlook, Eclipse, SQL Studio, Photoshop and a few RDP Sessions. Given that I think the performance would be much better for the average Joe with the same specs</p>]]>
    </content>
    <published>2008-08-08T17:28:33Z</published>
  </entry>

  <entry>
    <id>tag:www.insideria.com,2008://34.26345-comment:2020493</id>
    <thr:in-reply-to ref="tag:www.insideria.com,2008://34.26345" type="text/html" href="http://www.insideria.com/2008/08/i-accept-the-one-million-recor.html"/>
    <link rel="alternate" type="text/html" href="http://www.insideria.com/2008/08/i-accept-the-one-million-recor.html#comment-2020493" />
    <title>Comment from Noah Green on 2008-08-08</title>
    <author>
        <name>Noah Green</name>
        <uri></uri>
    </author>
    <content type="html" xml:lang="en" xml:base="">
        <![CDATA[<p>First of all, thanks for this extremely relevant and helpful article.  You are writing about exactly the things we are trying to do and it is a huge help!</p>

<p>I have a few comments / questions:</p>

<p>(1)<br />
When you change the "dataProvider" property of DataGrid, is the rendering and updating synchronous or asynchronous?  That is, does the call to "set dataProvider" block until the DataGrid rendering is complete?  I'm a novice to Flex's thread model (I know there really isn't much of one) so I don't know.  If the call is not synchronous - i.e. "set provider" returns right away, before the rendering is necessarily complete, then it might make sense to move the math from the final line of "onResult()" to a separate method called by the "updateComplete" event of the DataGrid.  Something like this (leaving out enclosing "script" and "CDATA" pieces):</p>

<p>     private function handleFinish(event:FlexEvent):void {<br />
      loadButton.enabled = true;<br />
         resultText.text = "data loaded in " + (loadComplete - initialTime) + "ms, data parsed in " + (getTimer() - loadComplete) + "ms, total " + (getTimer() - initialTime);<br />
       }</p>

<p>&lt;mx:DataGrid id="dg" updateComplete="handleFinish(event)" . . . /&gt;</p>

<p>I tried this myself and couldn't really distinguish much of a time difference - so maybe "set dataProvider" really is synchronous.  I dug into the Adobe source and found a call to "dispatchEvent()" but had trouble following from there.  What do you think?  </p>

<p>(2)<br />
Just to clarify, are you saying that this:</p>

<p>     private function onResult( event : ResultEvent ) : void<br />
      {  <br />
      . . . <br />
         dg.dataProvider = result;<br />
. . .<br />
       }</p>

<p>&lt;mx:DataGrid id="dg" . . . /&gt;</p>

<p>Is faster than this:</p>

<p>     private function onResult( event : ResultEvent ) : void<br />
      {  <br />
      . . . <br />
         dg.myProvider.source = result;<br />
. . .<br />
       }</p>

<p>&lt;mx:DataGrid id="dg" dataProvider="myProvider". . . /&gt;<br />
&lt;mx:ArrayCollection id="myProvider" /&gt;</p>

<p>I'm having trouble proving one way or the other.  My intuition would be to agree with you (one less layer of wrapping and change notification) but believe it or not, I sometimes get results where the second approach is faster.  Again what do you think?</p>

<p>(3)<br />
I think I got a minor improvement by substituting a String const for the ", " in the call to "split()".  </p>

<p>Thanks again for this excellent, thought-provoking piece.  This literally is what most Flex programmers writing business apps are thinking about every day, so I am very grateful you are addressing it!</p>

<p>Best,<br />
-Noah<br />
</p>]]>
    </content>
    <published>2008-08-08T17:33:36Z</published>
  </entry>

  <entry>
    <id>tag:www.insideria.com,2008://34.26345-comment:2020501</id>
    <thr:in-reply-to ref="tag:www.insideria.com,2008://34.26345" type="text/html" href="http://www.insideria.com/2008/08/i-accept-the-one-million-recor.html"/>
    <link rel="alternate" type="text/html" href="http://www.insideria.com/2008/08/i-accept-the-one-million-recor.html#comment-2020501" />
    <title>Comment from Noah Green on 2008-08-08</title>
    <author>
        <name>Noah Green</name>
        <uri></uri>
    </author>
    <content type="html" xml:lang="en" xml:base="">
        <![CDATA[<p>UPDATE:  I did some more tests and for item (2), the anomaly went away:  the first method is faster, just as you said in the article.  This would seem to say we should avoid using Collection classes as dataProviders when we can - for example when we are refreshing the entire record set on a given update, thus obviating the need for the binding/updating behavior the Collections provide.  That is, use Array over ArrayCollection and XMLList over XMLListCollection.  Would you agree?  If so I think it's important people know this, as the Adobe docs and tutorials seem to encourage people to use the Collection classes.</p>

<p>Also, I assume performance is a lot worse when we use XML, right?  That's more to think about.</p>

<p>Thanks again for the article, it really got me thinking.</p>]]>
    </content>
    <published>2008-08-08T20:57:59Z</published>
  </entry>

  <entry>
    <id>tag:www.insideria.com,2008://34.26345-comment:2020586</id>
    <thr:in-reply-to ref="tag:www.insideria.com,2008://34.26345" type="text/html" href="http://www.insideria.com/2008/08/i-accept-the-one-million-recor.html"/>
    <link rel="alternate" type="text/html" href="http://www.insideria.com/2008/08/i-accept-the-one-million-recor.html#comment-2020586" />
    <title>Comment from Andrew Trice on 2008-08-11</title>
    <author>
        <name>Andrew Trice</name>
        <uri>http://www.tricedesigns.com</uri>
    </author>
    <content type="html" xml:lang="en" xml:base="http://www.tricedesigns.com">
        <![CDATA[<p>Hi Noah,<br />
1)  When you set the dataprovider, it is not synchronus.  It flags the component as "dirty", which will invoke "validateProperties" later in the runtime lifecycle, which will invoke "invalidateDisplayList".   So, technically speaking, it is not complete until the displaylist has been validated.   Although, the time taken to render the graphics is trivial with respect to the time needed to parse the data.</p>

<p>2) You have to set the dataprovider to something first.  You can't just set dg.dataprovider.source because by default, the dataprovider is null.   You have to specify it as an instance of something.  In this case I used "Array".</p>

<p>Collections are the preferred object to use instead of "plain-old" XMLList and Array because collections support bindings and include helper functions to easily update specific items in the collection.   Basic Array or XMLList objects do not support binding or dispatch any data-binding events.   </p>

<p>In this case, I did not want any binding events to fire b/c of the huge size of the dataset.   Normally, you do want bindings to be applied, so that the grid contents are updated any time the contents of my collection is updated.  The Collection classes are extremely helpful for keeping you view/data model in synch.</p>

<p>3)Thanks, did it speed it up much?</p>

<p>4) I imagine XML will be much slower b/c there is more complex parsing involved, and the language itself if more verbose, and would have a larger file size.  I have not tested this.</p>]]>
    </content>
    <published>2008-08-11T13:07:56Z</published>
  </entry>

  <entry>
    <id>tag:www.insideria.com,2008://34.26345-comment:2020588</id>
    <thr:in-reply-to ref="tag:www.insideria.com,2008://34.26345" type="text/html" href="http://www.insideria.com/2008/08/i-accept-the-one-million-recor.html"/>
    <link rel="alternate" type="text/html" href="http://www.insideria.com/2008/08/i-accept-the-one-million-recor.html#comment-2020588" />
    <title>Comment from Richard Monson-Haefel on 2008-08-11</title>
    <author>
        <name>Richard Monson-Haefel</name>
        <uri>http://www.curl.com</uri>
    </author>
    <content type="html" xml:lang="en" xml:base="http://www.curl.com">
        <![CDATA[<p>Awesome display of power!  Thanks for taking up the 1 million record challenge. I see that I have my work cut out for me!</p>]]>
    </content>
    <published>2008-08-11T14:37:29Z</published>
  </entry>

  <entry>
    <id>tag:www.insideria.com,2008://34.26345-comment:2020590</id>
    <thr:in-reply-to ref="tag:www.insideria.com,2008://34.26345" type="text/html" href="http://www.insideria.com/2008/08/i-accept-the-one-million-recor.html"/>
    <link rel="alternate" type="text/html" href="http://www.insideria.com/2008/08/i-accept-the-one-million-recor.html#comment-2020590" />
    <title>Comment from Andrew Trice on 2008-08-11</title>
    <author>
        <name>Andrew Trice</name>
        <uri>http://www.tricedesigns.com</uri>
    </author>
    <content type="html" xml:lang="en" xml:base="http://www.tricedesigns.com">
        <![CDATA[<p>Thanks Richard,   I enjoyed the challenge, I can't say that this is anything I've ever tried before.   </p>]]>
    </content>
    <published>2008-08-11T14:46:24Z</published>
  </entry>

  <entry>
    <id>tag:www.insideria.com,2008://34.26345-comment:2020591</id>
    <thr:in-reply-to ref="tag:www.insideria.com,2008://34.26345" type="text/html" href="http://www.insideria.com/2008/08/i-accept-the-one-million-recor.html"/>
    <link rel="alternate" type="text/html" href="http://www.insideria.com/2008/08/i-accept-the-one-million-recor.html#comment-2020591" />
    <title>Comment from Tom Chiverton on 2008-08-11</title>
    <author>
        <name>Tom Chiverton</name>
        <uri>http://rachaelandtom.info/blogs/falken</uri>
    </author>
    <content type="html" xml:lang="en" xml:base="http://rachaelandtom.info/blogs/falken">
        <![CDATA[<p>"hard thing of handling a million rows or more in a data grid is multiple selection"<br />
If you're real world RIA is showing an end user a million rows at once, and expecting them to find the one(s) they want to select by looking through it by eye, you have a serous UX problem...</p>]]>
    </content>
    <published>2008-08-11T15:05:07Z</published>
  </entry>

  <entry>
    <id>tag:www.insideria.com,2008://34.26345-comment:2020592</id>
    <thr:in-reply-to ref="tag:www.insideria.com,2008://34.26345" type="text/html" href="http://www.insideria.com/2008/08/i-accept-the-one-million-recor.html"/>
    <link rel="alternate" type="text/html" href="http://www.insideria.com/2008/08/i-accept-the-one-million-recor.html#comment-2020592" />
    <title>Comment from Anonymous on 2008-08-11</title>
    <author>
        <name>Anonymous</name>
        <uri></uri>
    </author>
    <content type="html" xml:lang="en" xml:base="">
        <![CDATA[<p>Tom, Very valid point.   I can't imagine trying to fight a UI that makes you sort through a million records on your own.</p>]]>
    </content>
    <published>2008-08-11T15:19:53Z</published>
  </entry>

  <entry>
    <id>tag:www.insideria.com,2008://34.26345-comment:2020653</id>
    <thr:in-reply-to ref="tag:www.insideria.com,2008://34.26345" type="text/html" href="http://www.insideria.com/2008/08/i-accept-the-one-million-recor.html"/>
    <link rel="alternate" type="text/html" href="http://www.insideria.com/2008/08/i-accept-the-one-million-recor.html#comment-2020653" />
    <title>Comment from Naresh on 2008-08-12</title>
    <author>
        <name>Naresh</name>
        <uri>http://idsinfotech.com</uri>
    </author>
    <content type="html" xml:lang="en" xml:base="http://idsinfotech.com">
        <![CDATA[<p>hi</p>

<p>   i have a csv file with date and other datatype column.<br />
when i read it. it pick some date file and other field leave .<br />
 my dataset return all the record but some date field display empty.</p>

<p><br />
how can i handled.<br />
 </p>

<p>thanks</p>]]>
    </content>
    <published>2008-08-13T05:11:15Z</published>
  </entry>

  <entry>
    <id>tag:www.insideria.com,2008://34.26345-comment:2042105</id>
    <thr:in-reply-to ref="tag:www.insideria.com,2008://34.26345" type="text/html" href="http://www.insideria.com/2008/08/i-accept-the-one-million-recor.html"/>
    <link rel="alternate" type="text/html" href="http://www.insideria.com/2008/08/i-accept-the-one-million-recor.html#comment-2042105" />
    <title>Comment from Noah on 2008-08-31</title>
    <author>
        <name>Noah</name>
        <uri></uri>
    </author>
    <content type="html" xml:lang="en" xml:base="">
        <![CDATA[<p>Hi Richard,</p>

<p>Sorry I didn't reply sooner!  My "item 3" sped things up only a tiny bit, really.  </p>

<p>Thanks again for the article,<br />
-Noah<br />
</p>]]>
    </content>
    <published>2008-08-31T16:03:31Z</published>
  </entry>

</feed
