[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-hackers] [PATCH] Update irregex to 0.9.0
From: |
Peter Bex |
Subject: |
Re: [Chicken-hackers] [PATCH] Update irregex to 0.9.0 |
Date: |
Mon, 17 Sep 2012 09:07:03 +0200 |
User-agent: |
Mutt/1.4.2.3i |
On Mon, Sep 17, 2012 at 02:01:25PM +0900, Alex Shinn wrote:
> > I've done some quick benchmarks. There's the old "Chicken vs Perl"
> > chestnut:
> > http://lists.nongnu.org/archive/html/chicken-users/2011-09/msg00131.html
> >
> > Without patch:
> > interpreted: csi -s href-extraction.scm 3.75s user 0.11s system 97% cpu
> > 3.962 total
> > compiled (-O3): ./href-extraction 2.53s user 0.05s system 98% cpu 2.605
> > total
> >
> > With patch:
> > interpreted: csi -s href-extraction.scm 2.01s user 0.08s system 98% cpu
> > 2.126 total
> > compiled (-O3): ./href-extraction 1.34s user 0.08s system 98% cpu 1.434
> > total
> >
> > Unfortunately, Perl still takes our lunch:
> > perl extract.pl 0.05s user 0.01s system 83% cpu 0.072 total
> >
> > I'm unsure what the bottleneck is here. Warrants more investigation.
>
> Note this is an apples to oranges comparison - Perl
> is using an optimistic algorithm that does well in common
> cases like this. It will outperform even highly tuned C
> implementations of NFA matching like TRE or Google's RE
> here. On the other hand, there are patterns for which
> Perl takes exponential time.
Thanks for pointing this out.
I do think people are going to compare performance on real-world tasks
like this, and the closer we can get to Perl the more places Chicken
can be used for tasks like this. I haven't done that much investigation
yet, but I think I/O may be a big factor as well.
I also forgot to note that these benchmarks were run using a DEBUGBUILD
Chicken. The differences with a regular Chicken might be smaller.
Cheers,
Peter
--
http://sjamaan.ath.cx
--
"The process of preparing programs for a digital computer
is especially attractive, not only because it can be economically
and scientifically rewarding, but also because it can be an aesthetic
experience much like composing poetry or music."
-- Donald Knuth