develooper Front page | perl.perl5.porters | Postings from October 2016

[perl #129916] CV symbol table optimization only works in main::

Thread Next
From:
l.mai@web.de via RT
Date:
October 21, 2016 13:07
Subject:
[perl #129916] CV symbol table optimization only works in main::
Message ID:
rt-4.0.24-5988-1477055251-1069.129916-15-0@perl.org
On Wed Oct 19 07:20:42 2016, mauke- wrote:
> Here's the merge I'm talking about:
> http://perl5.git.perl.org/perl.git/commitdiff/f9d9e965
> 
> Also listed in perl5220delta:
> 
> Subroutines in packages no longer need to be stored in typeglobs:
> declaring a subroutine will now put a simple sub reference directly in
> the stash if possible, saving memory.
> 
> This works fine for the main script:
> 
> $ perl -wE 'sub foo { 42 } say $main::{foo}'
> CODE(0xa06f668)
> 
> But not in other packages:
> 
> $ perl -wE 'package Other; sub foo { 42 } say $Other::{foo}'
> *Other::foo
> 
> I.e. this optimization doesn't apply to modules, which is where most
> subroutines come from.

Here's a patch that adds a TODO test for now.

---
via perlbug:  queue: perl5 status: new
https://rt.perl.org/Ticket/Display.html?id=129916

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About