develooper Front page | perl.perl5.porters | Postings from September 2014

[perl #122861] [PATCH] for storage of NVs, use "IV in sv_u in head no-body trick" where possible

Thread Previous | Thread Next
From:
bulk88 via RT
Date:
September 28, 2014 16:43
Subject:
[perl #122861] [PATCH] for storage of NVs, use "IV in sv_u in head no-body trick" where possible
Message ID:
rt-4.0.18-18107-1411922603-1681.122861-15-0@perl.org
On Sun Sep 28 06:58:07 2014, sprout wrote:
> On Sun Sep 28 05:39:18 2014, smueller@cpan.org wrote:
> > On 09/28/2014 07:50 AM, bulk88 (via RT) wrote:
> > > # New Ticket Created by  bulk88
> > > # Please include the string:  [perl #122861]
> > > # in the subject line of all future correspondence about this
> > > issue.
> > > # <URL: https://rt.perl.org/Ticket/Display.html?id=122861 >
> >
> > > See attached patch. I am surprised Nicholas didn't do this in the
> > > original "IV is now bodyless" patch, and nobody else thought of it
> > > for 9
> > > years. I had heap corruption (a bodyless NV had free() called on
> > > it) and
> > > in DEBUGGING failed an existing assert on 1st try of this patch but
> > > it
> > > was fixed.
> >
> > Around that time, Nicholas and I spoke about squeezing NVs into the
> > SV
> > HEAD. But IIRC the reason not to do it was because on some systems
> > sizeof(NV) > sizeof(IV)
> 
> Maybe even most systems at the time.  But the trend is changing, with
> everybody going 64-bit.

Some porters had to have 64 bit big endian unix workstations in 2005 didnt they?

> > and the special casing of some systems wasn't
> > deemed worth the small gain (NVs aren't that common in most Perl
> > code).

There isn't very much special casing, only 6 #ifs, and assuming nobody finds bugs with this patch after it is applied or tried with CPAN at large, it will stay at 6 #ifs. I'd asusme PDL uses NVs alot. (I dont use PDL).

> Do you think it’s worth it now?  (I think it is.)

I know this isn't address to me. It is worth it since it is free memory that would otherwise be unused for SVNVs. Plus whatever CPU caching gain from being in the head.

New patch attached. Due to issues raised on #p5p over NVU token being very short and therefore likely to conflict with 3rd party headers, I renamed it to a suggestions by dmq.

-- 
bulk88 ~ bulk88 at hotmail.com

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

Thread Previous | 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