develooper Front page | perl.perl5.porters | Postings from July 2011

Re: Why is there a sizing pass in regex compilation

Thread Previous
From:
Reini Urban
Date:
July 2, 2011 22:08
Subject:
Re: Why is there a sizing pass in regex compilation
Message ID:
CAHiT=DG+an-b9+O5e3sk1aYjeanrCs+9RbvZeHXjc98VKUtgBg@mail.gmail.com
2011/7/3 Karl Williamson <public@khwilliamson.com>:
> I know Yves has said that he hates this aspect of this.  It looks to me that
> it should be easy to remove this pass, and treat regex compilation similarly
> to string parsing: if you run out of room from your initial guess, you just
> realloc more space, trimming at the end.
>
> Is there something people are aware of that I'm not seeing here?

Performance probably.

I had the same problem in my Jit, and Gerard in his codegen.
I used two passes because realloc was a performance pain and my blocks
were quite large. Gerard used the single-pass realloc approach.
Benchmarks are missing to compare both cases. Both versions are
"relatively slow".
-- 
Reini

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About