lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

Hi Steve,

I have not yet looked into your code but one question springs to mind
immediately: have you done some benchmarks (informal or otherwise), eg
with a pure-Lua solution that works with LPEG or some other
pattern-matching algorithms? I am confident that a low-level interface
would be faster than pure Lua... the question is how much faster?

cheers  thomasl

steve donovan <> wrote:
----original message----
From: steve donovan <>
Date: Mon, 3 Aug 2009 13:33:55 +0200
Subj: [ANN] LuaCSV
> Hi all,
> Recently we were talking about CSV format again, and there was a
> suggestion that we needed a fast low-level extension [1]
> Well, [2] is an attempt to supply that extension.  It does the quoting
> rules correctly, as far as I can tell, but does not do the case where
> multiline records are encoded in double-quotes.  That is an exercise
> for another day.
> It provides an iterator, which returns the _same table_  each time. So
> for a little inconvenience in some cases, one gets absolutely minimal
> hit on Lua memory. The returned table does have a copy() method,
> however.
> By default, it looks at the first data line and works out whether they
> are to convertible to numbers. Thereafter, it keeps a mask of these
> fields and converts them. This will particuarly help you if you have a
> lot of numerical data to bring in.  (You can always switch it off if
> it guesses incorrectly)
> Tested on Debian 32-bit (gcc), and Windows XP (MS compiler).  The zip
> contains a dll for those poor Windows souls without compilers.
> steve d.
> 1
> 2