23.03.2013 Views

Performance and Evaluation of Lisp Systems - Dreamsongs

Performance and Evaluation of Lisp Systems - Dreamsongs

Performance and Evaluation of Lisp Systems - Dreamsongs

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

§ 3.13 Division by 2 187<br />

As is apparent from the metering, these benchmarks simply CONS, take CAR<br />

<strong>and</strong> CDR, <strong>and</strong> do some function calling or GO’ing.<br />

These benchmarks were proposed by a computer scientist at Bell Laborato-<br />

ries. He thought that they best epitomized what his programs did—function-calls,<br />

CONS, CAR, CDR, <strong>and</strong> iteration. He wanted to find out how Franz <strong>Lisp</strong> on a<br />

Vax 11/780 did vis-à-vis other implementations. He was surprised to find out<br />

that the iterative version ran slower than the recursive one on the Vax 11/780.<br />

After some investigation, we found out that the iterative version had a number<br />

<strong>of</strong> sequential MOVL instructions in a row—more than the recursive version. At<br />

that time (1982), the Vax 11/780 did very poorly on MOVL’s, <strong>and</strong> by counting<br />

cycle times we were able to justify the results we saw. Since then, the problem<br />

has been corrected on Vaxes <strong>and</strong> possibly in Franz itself.<br />

Meter for Iterative Div2<br />

Cdr’s 240000<br />

Null’s 121200<br />

Cons’s 120200<br />

Car’s 120000<br />

ITERATIVE-DIV2 1200<br />

=’s 201<br />

1−’s 200<br />

CREATE-N 1<br />

Total 603002<br />

3.13.3 Translation Notes<br />

The INTERLISP versions are straightforward:<br />

Meter for Recursive Div2<br />

Cdr’s 240000<br />

Null’s 121200<br />

RECURSIVE-DIV2 121200<br />

Cons’s 120200<br />

Car’s 120000<br />

1−’s 200<br />

=’s 201<br />

CREATE-N 1<br />

Total 723002<br />

(DEFINEQ<br />

(DIV2<br />

(LAMBDA (l)<br />

(for L A on l by (CDDR L) do (push A (CAR L))<br />

finally (RETURN A))))<br />

(DV2<br />

(LAMBDA (l)<br />

(if (NULL l)<br />

then NIL<br />

else (CONS (CAR l)<br />

(DV2 (CDDR l)))))))

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!