[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: [ANN] LuaCSV
- From: steve donovan <steve.j.donovan@...>
- Date: Mon, 3 Aug 2009 15:17:59 +0200
On Mon, Aug 3, 2009 at 2:43 PM, Thomas Lauer<firstname.lastname@example.org> wrote:
> 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?
The results were rather interesting:
I compared against the pure Lua solution given in
http://lua-users.org/wiki/CsvUtils. My first result showed them
basically taking the same, until I realized that by default I'm doing
the floating-point conversion.
The target was a 20meg csv file, randomly generated rows of ten numbers.
(A) No floating-point conversion:
(B) Floating point conversion:
(This just added up all the numbers)
So the conversions are expensive; if you need them, it's cheaper to do
them in C.