Front page | perl.perl5.porters |
Postings from January 2022
Re: PSC #049 2022-01-07
Thread Previous
|
Thread Next
From:
Felipe Gasper
Date:
January 17, 2022 14:55
Subject:
Re: PSC #049 2022-01-07
Message ID:
21CAA334-9D5C-4C03-BE91-02F746422AF2@felipegasper.com
> On Jan 17, 2022, at 07:31, Dave Mitchell <davem@iabyn.com> wrote:
>
> On Sun, Jan 09, 2022 at 11:33:29AM -0500, Ricardo Signes wrote:
>> On Sun, Jan 9, 2022, at 7:37 AM, Neil Bowers wrote:
>>> Our overriding desire is to get signatures "out there", but what's the right next step? There are at least 4 options:
>>> 1. Remove the experimental sticker off signatures and release that way in 5.36 (so you'd still have to `use feature` or `use v5.36`), but no other changes.
>>> 2. As for 1, but also add a runtime warning if you touch @_ inside a signatured-sub.
>>> 3. Like 2, but touching @_ is fatal.
>>> 4. Inside signatured-subs @_ becomes non-special.
>>
>> I am strongly in favor of #1.
> [snip] stuff
>
> There seems to be a lot of confusion and misconceptions present in this
> thread.
>
> My preferred solution consists of doing all of the following:
>
> 1) leaving @_ untouched when calling a signatured-sub (i.e. it is still
> the @_ of the caller).
>
> This will have a significant performance boost, especially when calling
> small stub functions like accessors. At the moment perl has to do the
> equivalent of
>
> my @args = (...);
> local *_ = \@args;
>
> for every sub call (even ones without args), setting up, aliasing,
> unaliasing etc. It will also make assigning args to parameters faster.
>
> Eventually over time as signatures become the norm, @_ will be remembered
> just as some old weird thing perl used to do (like we occasionally
> encounter perl4-isms).
The points heretofore raised in response to this seem to be:
1) There is no viable branch currently that implements leaving @_ untouched.
2) The performance gain has yet to be shown.
I’d love to help in either of these regards, but I lack the knowledge to assist with #1, and #2 can’t happen without the former.
-F
Thread Previous
|
Thread Next