[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-users] Chicken vs Perl
From: |
Daishi Kato |
Subject: |
Re: [Chicken-users] Chicken vs Perl |
Date: |
Tue, 20 Sep 2011 22:52:16 +0900 |
User-agent: |
Wanderlust/2.14.0 (Africa) Emacs/21.4 Mule/5.0 (SAKAKI) |
At Tue, 20 Sep 2011 15:18:30 +0200,
Peter Bex wrote:
>
> On Tue, Sep 20, 2011 at 10:08:16PM +0900, Daishi Kato wrote:
> > Hi,
> >
> > My situation is pretty similar to yours, meaning I used to use Perl
> > and later started using Chicken for my job.
> >
> > Running your scripts on my machine produced similar result
> > (about 10 times difference).
> >
> > -unsafe option in csc-4.6.0 didn't work (no change).
> > -unsafe-libraries in csc-4.0.0 did work (a little faster),
> > but it's not available in csc-4.6.0 (does anybody know why?).
> >
> > I also tried with csc-4.7.0, and guess what, it's a little slower
> > (at least on my test data. I partially crawled wiki.call-cc.org).
> > Peter, how could this happen?
>
> This probably depends on the nature of your regex. We made the
> tradeoff that large consecutive ranges of characters are stored
> more efficiently as a range instead of as separate characters.
> This means that if you are using a regex with many separate chars
> it could be slightly slower.
>
> In some cases regexes can't be compiled to DFA but need to use
> backtracking, which is comparatively slow. That's not the case
> in Sascha's regex (I checked), but might be the reason it's slow
> for you.
I would like to note that I used the script that Sascha posted.
Let me try with a somewhat larger test set.
% wget -r -l2 http://wiki.call-cc.org/manual/index
% du -s wiki.call-cc.org
2528 wiki.call-cc.org
% time /usr/local/chicken-4.7.0/bin/csi -s a.scm wiki.call-cc.org > /dev/null
/usr/local/chicken-4.7.0/bin/csi -s a.scm wiki.call-cc.org > /dev/null 3.88s
user 0.16s system 85% cpu 4.708 total
% time /usr/local/chicken-4.6.0/bin/csi -s a.scm wiki.call-c
c.org > /dev/null
/usr/local/chicken-4.6.0/bin/csi -s a.scm wiki.call-cc.org > /dev/null 3.13s
user 0.13s system 86% cpu 3.771 total
% grep regexp a.scm
(define href (regexp "href=\"(http://[^\"/?]+)([\"/?].*)" #t))
% uname -r -v -o
2.6.39-2-686-pae #1 SMP Tue Jul 5 03:48:49 UTC 2011 GNU/Linux
Best,
Daishi
- Re: [Chicken-users] Chicken vs Perl, (continued)
- Re: [Chicken-users] Chicken vs Perl, Christian Kellermann, 2011/09/20
- Re: [Chicken-users] Chicken vs Perl, Peter Bex, 2011/09/20
- Re: [Chicken-users] Chicken vs Perl, Alan Post, 2011/09/20
- Re: [Chicken-users] Chicken vs Perl, Daishi Kato, 2011/09/20
- Re: [Chicken-users] Chicken vs Perl, Felix, 2011/09/20