Path: utzoo!mnetor!uunet!lll-winken!lll-lcc!ames!pasteur!ucbvax!hplabs!sdcrdcf!sdcsmb!sea!eggert From: eggert@sea.sm.unisys.com (Paul Eggert) Newsgroups: comp.lang.lisp Subject: Re: Lisp vs. C Floating Point (Suns) Message-ID: <6@sea.sm.unisys.com> Date: 30 Jan 88 19:17:18 GMT References: <536@spar.SPAR.SLB.COM> Reply-To: eggert@sea.sm.unisys.com (Paul Eggert) Organization: Unisys Santa Monica Lines: 45 Summary: Expires: Sender: Followup-To: Distribution: Keywords: In article <536@spar.SPAR.SLB.COM> malcolm@spar.SPAR.SLB.COM (Malcolm Slaney) gives a C version on of the Barrow/Gabriel/Lucid FFT benchmark, and concludes that Lisp compilers now generate code as fast as the code that C compilers generate. But his C version's register declarations could stand improvements; in particular, the key scalar variables should be put in registers. Given the changes to his program suggested at the end of this message, C's performance goes up 15-20% on a Sun-3 with 68881, so his table should be revised. (I lack access to the other kinds of Suns he benchmarked and so will omit their figures.) Time (in seconds) to execute 10 iterations of a 1024 point FFT Sun-3/160 Sun-3/160 (original) (revised) Double 68881 C 5.0 4.1 Single 68881 C 4.8 4.2 Single 68881 Lucid 2.1.1 4.7 4.7 Even with these changes, I would like to see a better benchmark for relating the quality of C compilers versus Lisp compilers. The FFT benchmark is dominated by floating point work, which is relatively insensitive to the choice of language and compiler. Even if we were to pick a different Gabriel benchmark, blindly translating an existing Lisp program into C (as Slaney has done) biases the results in favor of Lisp. *** fftorig.c Sat Jan 30 09:09:15 1988 --- fft.c Sat Jan 30 10:13:45 1988 *************** *** 46,52 **** */ register float *ar = areal, *ai = aimag; ! register int i = 1, j = 0, k = 0, m = 0; ! int n = 1024, nv2 = 512, le = 0, ! le1 = 0, ip = 0; ! float ur = 0.0, ui = 0.0, wr = 0.0, wi = 0.0, tr = 0.0, ti = 0.0; register int l; --- 46,53 ---- */ + register int i = 1, ip = 0; register float *ar = areal, *ai = aimag; ! register float ur = 0, ui = 0, tr = 0, ti = 0; ! register int le1 = 0, le = 0, n = 1024, j = 0, k = 0, m = 0; ! register int nv2 = n>>1; ! register float wr = 0, wi = 0; register int l;