[LRUG] Reading a "large" spreadsheet
Frederick Cheung
frederick.cheung at gmail.com
Fri Mar 15 06:51:26 PDT 2013
On 15 Mar 2013, at 13:49, Graham Ashton <graham at effectif.com> wrote:
> On 15 Mar 2013, at 13:40, Andrew Stewart <boss at airbladesoftware.com> wrote:
>
>> How can I read the 900 actual rows in a few seconds?
>
> I suspect you'll need a SAX parser. Rather than trying to load the whole thing into RAM, a SAX parser fires events as it reads a stream of bytes such as "found an opening <foo> tag" and "found a closing </foo> tag". You just need to write the code that responds to the events. They're much faster on large documents than XML parsers that attempt to load the entire document into memroy.
>
> Nokogiri may be a SAX parser - I've never tried to look inside it. Maybe Roo is using Nokogiri to load everything before trying to operate on it. Again, I don't know.
>
Nokogiri can do both
Fred
More information about the Chat
mailing list