develooper Front page | perl.perl5.porters | Postings from December 2011

[perl #36459] Investigate sv_setuv

Thread Next
From:
James E Keenan via RT
Date:
December 28, 2011 16:24
Subject:
[perl #36459] Investigate sv_setuv
Message ID:
rt-3.6.HEAD-14510-1325118292-1923.36459-15-0@perl.org
On Mon Jul 04 03:22:32 2005, nicholas wrote:
> This is a bug report for perl from nick@ccl4.org,
> generated with the help of perlbug 1.35 running under perl vv5.9.3.
> 

> How expensive are 32 million function calls?
> 
> gcov says:
> 
> 		void
> 		Perl_sv_setuv(pTHX_ register SV *sv, UV u)
>     32637341    {
> 		    /* With these two if statements:
> 		       u=1.49  s=0.52  cu=72.49  cs=10.64  scripts=270  tests=20865
> 
> 		       without
> 		       u=1.35  s=0.47  cu=73.45  cs=11.43  scripts=270  tests=20865
> 
> 		       If you wish to remove them, please benchmark to see what the
>    effect is
> 		    */
>     32637341        if (u <= (UV)IV_MAX) {
>     32546899           sv_setiv(sv, (IV)u);
>     32546899           return;
> 		    }
>        90442        sv_setiv(sv, 0);
>        90442        SvIsUV_on(sv);
>        90442        SvUV_set(sv, u);
> 		}
> 
> Might be worth investigating the true effect of that if statement,
> and if moving it up into the macros that call sv_setuv helps.
> 
> Nicholas Clark
> 

Six-and-a-half years later, the inline comments are unchanged.  But I
only see *one* 'if' statement in the code, not two.  Am I missing something?

Nick, is this issue still a concern?

Thank you very much.
Jim Keenan

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

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