[RFC] Possible PCT performance improvements.

Patrick R. Michaud pmichaud at pobox.com
Sat Aug 14 23:38:17 UTC 2010


On Sat, Aug 14, 2010 at 05:21:14PM -0300, Daniel Arbelo wrote:
>    Discussing it in #parrot chromatic suggested need something like a
> "streq_at" op that answers "Does this string at this position contain
> exactly this substring?". Does this sound like something PCT could
> use? Is it worth adding to parrot? Is there anything else parrot can
> do to make code of this kind less likely to be written in the future?

I've suggested a "compare substring at position" opcode several times,
but so far nobody (including myself) seems to have found the tuits to
create it.

If/when the opcode is added, I'll gladly fix up NQP and the regex engine
to take advantage of it.  Ideally I'd like something like:

    $I0 = substreq $S0, $S1, $I1

which should mean something along the lines of

    Compare the string in $S0 with an equivalent-length substring of
    $S1 starting at position $I1; return true if matched and false otherwise.
    
Pm


More information about the parrot-dev mailing list