develooper Front page | perl.perl5.porters | Postings from January 2012

Re: whither study()?

Thread Previous | Thread Next
January 31, 2012 06:17
Re: whither study()?
Message ID:
On 31 January 2012 14:52, Andy Dougherty <> wrote:
> On Mon, 30 Jan 2012, Ricardo Signes wrote:
>> * demerphq <> [2012-01-29T04:41:33]
>> > Is it really in Perls interest that I, or anyone else with the chops,
>> > even looks at fixing the bugs related to it? Can we just no-op and
>> > deprecate it?
>> The promise of study is that everything will work the same, with some shift in
>> where cost is.  What if study became a nop?
>> We could issue a "useless use of study" but do we really need a warning?  The
>> change would be "fixed a bug where study caused regex matches to behave
>> incorrectly," and the performance hit would be like any other disabled bad
>> optimization.  What do we know about how much real effect this would be likely
>> to have?
>> > Does anybody have any examples where it actually makes a difference?
>> I second that question, but I only care if the difference is the kind of thing
>> we want to keep around. ;)
> Yes, I've used it, and yes it has typically made a difference (around 5%
> last several times I benchmarked it).  However, I've only used it for
> simple patterns of straight ASCII text.  I haven't run into any corner
> cases or subtle bugs, but I haven't stressed it too much either.

If you have a case you can share I would really like to see it. My
thinking is that other strategies might provide better results.

> If the most sensible way to fix it is to turn it into a no-op, then that
> sounds like a good plan to me.  I would prefer that it not issue a warning
> or be deprecated unless that is a necessary part of fixing whatever bugs
> are uncovered.  This way, code that currently runs cleanly will continue
> to run cleanly without intervention.

Definitely. I was hasty when I said "deprecate". No-op is what we
want, as maybe one day it might do something useful.


perl -Mre=debug -e "/just|another|perl|hacker/"

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About