Re: [RFC] Possible PCT performance improvements.

2010-08-16 Thread Patrick R. Michaud
On Sun, Aug 15, 2010 at 09:40:32PM -0700, chromatic wrote: > On Saturday 14 August 2010 at 16:38, Patrick R wrote: > > > 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

Re: [RFC] Possible PCT performance improvements.

2010-08-15 Thread chromatic
On Saturday 14 August 2010 at 16:38, Patrick R wrote: > 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 I added substr_eq_at on the substr_eq_at branch; updates to NQP and t

Re: [RFC] Possible PCT performance improvements.

2010-08-15 Thread chromatic
On Saturday 14 August 2010 at 16:38, Patrick R wrote: > 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 tak

Re: [RFC] Possible PCT performance improvements.

2010-08-14 Thread Jonathan Worthington
Austin Hastings wrote: It seems likely to me that using if $var.name[0] == '&' { might be faster, without any need to do any more work. Can you try this? Perl 6 strings don't array-index to provide a char/grapheme/codepoint/whatever - if this does work, its an artefact of Parrot's String

Re: [RFC] Possible PCT performance improvements.

2010-08-14 Thread Patrick R. Michaud
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 addi

Re: [RFC] Possible PCT performance improvements.

2010-08-14 Thread Daniel Arbelo
On Sat, Aug 14, 2010 at 7:13 PM, Austin Hastings wrote: > It seems likely to me that using >     if $var.name[0] == '&' { > > might be faster, without any need to do any more work. Can you try this? Even though I'm not familiar with NQP's code generation code, I doubt this could beat an ord op

Re: [RFC] Possible PCT performance improvements.

2010-08-14 Thread Austin Hastings
It seems likely to me that using if $var.name[0] == '&' { might be faster, without any need to do any more work. Can you try this? =Austin might be a faster Daniel Arbelo wrote: Fellow parrot developers, Yesterday, while doing some profiling work on the unshared_buffers branch, I no

[RFC] Possible PCT performance improvements.

2010-08-14 Thread Daniel Arbelo
Fellow parrot developers, Yesterday, while doing some profiling work on the unshared_buffers branch, I noticed an interesting pattern in our PIR and NQP code, which is exemplified by the following nqp snippet: unless pir::substr($var.name, 0, 1) eq '&' { I've also seen this done in PIR in sev