develooper Front page | perl.perl5.porters | Postings from February 2018

[perl #132252] Blead Breaks CPAN: Role::Tiny, Variable::Magic, Moo

Thread Previous | Thread Next
Father Chrysostomos via RT
February 1, 2018 22:20
[perl #132252] Blead Breaks CPAN: Role::Tiny, Variable::Magic, Moo
Message ID:
On Mon, 29 Jan 2018 21:31:31 -0800, haarg wrote:
> On Mon, Jan 29, 2018 at 6:01 PM, Sergey Aleynikov via RT
> <> wrote:
> > On Mon, 29 Jan 2018 05:51:38 -0800, haarg wrote:
> >> This seems like lot of breakage for such a tiny benefit.
> >
> > All those modules are already broken on the current perl version (and
> > some versions back in time), they just don't test for it - as globs
> > are already not created for subs in the 'main' package.
> They are "broken" in a way that nobody has noticed for a long time.
> Most of the modules that are failing will usually not be used against
> the main package.  Breaking the tests of this many modules for an edge
> case like this is a poor trade off.

I will point out that most of the module I patched already fail with constants for the same reason.  I.e., we have uncovered existing bugs in many modules.

I do agree, though, that this amount of breakage warrants a revert.  Would you be adverse to reënabling the optimisation in blead after 5.28?

> >
> >> Additionally, since the stash entries get de-optimized to globs when
> >> called as methods, this change will actually lead to increased
> >> memory
> >> usage on servers that fork.  Many methods won't get called until
> >> post-
> >> fork, so the globs will need to be created for every fork instead of
> >> being able to benefit from copy-on-write.
> >
> > You can't rely on copy-on-write for almost all non-optree data (and
> > sometimes even on optree too), as any run-time SV upgrade/free will
> > touch the whole page. Furthermore, there're constant subs (sub foo ()
> > {42}), which are almost never called as methods - and by reverting
> > this we will loose memory savings on them.
> The actual memory savings is minuscule.  I'm not sure what you are
> referring to with constant subs.  Constants are more commonly created
> via, which uses a different optimization of storing scalar
> refs in the symbol table.  That optimization makes more sense since
> they aren't commonly called as methods.

(I hope you will respond to Mr. Aleynikov’s point about copy-on-write.  Such programs also suffer from modules that do autoloading.)


Father Chrysostomos

via perlbug:  queue: perl5 status: open

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