From: J W Dalton
Subject: Re: Fannkuch revisited or Benchmarking is hard
Date: 
Message-ID: <CxBCqL.K05@festival.ed.ac.uk>
······@ee.pdx.edu (Marcus Daniels) writes:

>In-reply-to: ····@aiai.ed.ac.uk's message of Tue, 4 Oct 1994 17:19:12 GMT

>>>>>> "Jeff" == Jeff Dalton <····@aiai.ed.ac.uk> writes:
>In article <··········@cogsci.ed.ac.uk> ····@aiai.ed.ac.uk (Jeff Dalton) writes:

>>>  How about starting with some examples of what some of these
>>> implementation-specific things are, and why complete dpANS
>>> declarations aren't sufficient.

>Jeff> I don't have any good implementation-specific examples handy
>Jeff> (remember it's not *my* view that it's all too
>Jeff> implementation-specific), but I can recall doing the following
>Jeff> for a numeric / array benchmark:

>Jeff> #+:cmu (deftype index () `(unsigned-byte 32))

>(probably 29?)

No, 32.

>Jeff> #-:cmu (deftype index () 'fixnum)

>Provided the programmer uses declarations that correctly specify a
>minimal-needed range of numbers, this isn't a problem.  That is,
>unless you get time/space tradeoffs you weren't informed-of by the
>compiler.

Do you mean in CMU CL or CL in general?  If in general, ranges
don't always work.

>Jeff> I'm not sure what you mean by "complete dpANS declarations".
>Jeff> Which types would you pick?  Where would you use "the"?

>Assuming the LISP programmer leaves nothing the chance (in some
>empirically-discovered `hot spot' of an application), by paranoid use of all
>the declarations that dpANS CL provides, can we say that
>these applications will have somewhat predictable performance
>characteristics for any LISP implementation which uses the 
>declaration information?

That's almost a tautology.  But in practice putting in more
declarations can make things worse.  (I don't have examples handy,
but some have been posted in Comp.lang.lisp in the past.
Moreover, there are cases where specialized storage is worse,
because heap objects have to be repeatedly created from the
specialized ones.  I suppose it's "somewhat predictable" when
this will happen, but I'm not sure that helps very much.)

It's also not clear what types would be used.  "All the declarations
that dpANS CL provides" doesn't say.  Nor does it clearly answer
my question about "the".  Indeed, I really can't tell exactly what
you mean by "all the declarations that dpANS CL provides".

>In my experience, it will, but the larger problem IMHO is that the
>performance critical *areas* change for the not-so-well-
>declared-but-one-wouldn't-expect-problems areas of a program.

I don't know what you mean by this.

>1.  Even a fairly carefully implemented LISP program, using  
>    declarations, performance can vary widely.  Even across
>    industrial-strength LISP implementations.

>2.  Declarations everywhere make an application harder to maintain,
>    and start to defeat the reason for using LISP in the first place.

>2.  Many programmers rightly consider the need for knowledge of a 
>    particular compiler/runtime design a Bad Thing.

>Can anyone refute these assertions?

I think they're roughly true, but I don't think they imply very much
for Lisp as opposed to implementations of Common Lisp.

Why do you say "LISP", not "Lisp", BTW?

-- jeff