Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

Re^9: Speeding up named capture buffer access

by ikegami (Pope)
on Dec 01, 2009 at 18:18 UTC ( #810433=note: print w/replies, xml ) Need Help??

in reply to Re^8: Speeding up named capture buffer access
in thread Speeding up named capture buffer access

Just code the equivalent of mine in your method, and benchmark that. It should give a pretty accurate idea.
  • Comment on Re^9: Speeding up named capture buffer access

Replies are listed 'Best First'.
Re^10: Speeding up named capture buffer access
by SBECK (Chaplain) on Dec 01, 2009 at 19:29 UTC

    I created a very simple example that matched some simple times with a few different formats, and benchmarked it using named capture buffers, alternative capture group numbering, and your method with embedded code. The alternative capture method is about 40% faster than the named buffers (so I'm going to be implementing it for at least some of the regular expression matching where the order of the matches stays the same). The embedded code was significantly slower (7x) than the named buffers. It's possible I wasn't doing it as efficiently as possible, but given that:

        it appears to be significantly slower
        it's listed as an experimental feature
        the regular expressions are more complicated
    I think that I'll pass on it for the time being. But it was fun to experiment with something new!

      yeah, I figured the sub calls would significantly slow things down.

      The use of (?{}) doesn't complicate things. It's use is minimal, and it's use is the same for every subpattern. Using it just shifts code from outside the pattern into the pattern. Specifically, it removes the need to parse the returned values a second time in order to get numbers. However, the use of rc does complicate things.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://810433]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (2)
As of 2021-06-16 00:41 GMT
Find Nodes?
    Voting Booth?
    What does the "s" stand for in "perls"? (Whence perls)

    Results (74 votes). Check out past polls.