[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: precompiled regex's to lua
- From: askok@...
- Date: Fri, 10 Nov 2006 13:59:06 +0200
Here's the inofficial results of a small (20+ lines) test,
run on three candidates.
- Perl is about 2x faster than Lua
- C is about 8x faster than Perl (NOT using regex,
but csv in C wouldn't need either..)
- Perl performance is _not_ dependent on the way one
describes the regex (= it seems to automatically cache
System: PowerBook G4 1,6GHz OS X
The exact times, especially 'real' are not that important.
The magnitudes are.
# Perl (qr//): 28s (31.37 real 26.58 user 1.19
# Perl (//o): 28s (43.45 real 26.70 user 1.58
# Perl (//): 28s (30.32 real 26.50 user 1.17
# Lua (match): 50s (70.44 real 48.70 user 1.71
# Lua (gmatch): 1min 17s (88.00 real 75.11 user 1.62
# C (gets, strchr, -O3): 4s (4.48 real 3.33 user 0.74
For comparison, running "wc -l" on the file to get the
# wc (raw read): 2.7s (30.96 real 1.49 user 1.22 sys)
On Fri, 10 Nov 2006 15:29:32 +1100
"David Burgess" <email@example.com> wrote:
How does gmatch compare?