develooper Front page | perl.perl5.porters | Postings from January 2001

Re: Does perl really need to use sigsetjmp? (18% performance hit)

Thread Previous | Thread Next
From:
Nicholas Clark
Date:
January 20, 2001 10:44
Subject:
Re: Does perl really need to use sigsetjmp? (18% performance hit)
Message ID:
20010120184419.B99529@plum.flirble.org
On Thu, Jan 11, 2001 at 03:46:37PM +0000, Nick Ing-Simmons wrote:
> Alan Burlison <Alan.Burlison@uk.sun.com> writes:
> >> Can you tell me if passing 0 to sigsetjmp(b,0) is significantly slower
> >> than setjmp() for you ? (Solaris, OS/2)
> >
> >Solaris/sparc
> >$ jmp
> >Loop overhead: 22 ns/iter
> >setjmp(jb): 32 ns/call
> >sigsetjmp(sjb, 0): 11795 ns/call
> >sigsetjmp(sjb, 1): 11856 ns/call

> Loop overhead: 16 ns/iter
> setjmp(jb): 101 ns/call
> sigsetjmp(sjb, 0): 101 ns/call
> sigsetjmp(sjb, 1): 1288 ns/call
> 
> Mods to program are to provide medium-res time function and bump 
> loop count to compensate.

Using Nick's linux timer function on BSD:

cc -O -pipe  jmp.c  -o jmp

Loop overhead: 597 ns/iter
setjmp(jb): 8032 ns/call
sigsetjmp(sjb, 0): 2438 ns/call
sigsetjmp(sjb, 1): 8173 ns/call

cc -O2 -o jmp jmp.c

Loop overhead: 17 ns/iter
setjmp(jb): 32171 ns/call
sigsetjmp(sjb, 0): 51 ns/call
sigsetjmp(sjb, 1): 31795 ns/call

this is with:
gcc version 2.95.2 19991024 (release)
FreeBSD plum.flirble.org 4.2-STABLE FreeBSD 4.2-STABLE #0: Tue Dec  5 16:05:22 GMT 2000     james@plum.flirble.org:/usr/obj/usr/src/sys/PLUM  i386

What is the optimiser up to?

Nicholas Clark

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