On Friday 04 June 2004 17:46, Gavin Kistner wrote:
> On Jun 2, 2004, at 10:57 AM, Simon Strandgaard wrote:
> > Encodings supported: ASCII, UTF8.
> >   (?: ... )     non-capturing group
> >   (?> ... )     atomic grouping
> >   (?= ... )     positive-lookahead
> >   (?! ... )     negative-lookahead  . . . . . . . . . . . . . . . . .
> > . . see [2]
> >   (?<= ... )    positive-lookbehind . . . . . . . . . . . . . . . . .
> > . . see [1]
> >   (?<! ... )    negative-lookbehind . . . . . . . . . . . . . . . . .
> > . . see [1], [2]
>
> w00t! Thanks so much, Simon!
>

I am happy you like it.. yesterday I added support for
UTF-16BE and UTF-16LE.   Now im working on perl6 syntax.


> How is the performance of yours vs. built-in? (On features which they
> both support.)
>

performance hasn't really been benchmarked yet. 
However we can compare against the time between Ruby's builtin (GNU)
engine.. 

First engine 0.11
'test_blackbox_p5.rb'  takes  16.86 seconds for ~400 tests.
'test_blackbox_rubicon.rb' takes 15.93 seconds for ~1520 tests.
In total ~ 31 seconds for about 1900 regexp.
In average we can execute about 61 regexp's per second.

Then builtin GNU
'test_engine_builtin.rb' takes 2.96 seconds for 2000 tests.
The builtin can do 675 per second.


Lets calculate how many times GNU is faster
675 / 61  = 11
So GNU can do eleven times as many operations per second than mine.
This surprices me a little.. I thought my engine were way slower ;-)
I am thinking about reimplementing only the scanner in C++, in order
to get better performance.  But first I must implement some of the
most common regexp optimizations: fastmaps and single-repeat.

Has anyone experience with how much speed can be gained 
by reimplementing a ruby algorithm in C/C++ ?

my environment are:
bash-2.05b$ cat /proc/cpuinfo | grep MH
cpu MHz         : 726.631
bash-2.05b$ uname -a
Linux server 2.4.25-gentoo-r1 #1 Sun Jun 6 18:09:28 CEST 2004 i686 AMD 
Duron(TM)Processor AuthenticAMD GNU/Linux
bash-2.05b$ ruby18 -v
ruby 1.8.1 (2004-04-24) [i386-linux-gnu]
bash-2.05b$

--
Simon Strandgaard

BTW: sorry for the 5 day delay.. I had to reinstall my system.
Actually I switched from FreeBSD to Gentoo Linux.