> Did you try running square-df?
> 
> * (square-df 5d0)

Yeah, I'd just figured that out.

> First, you can declare square-df-int to be an inline function.  That
> will help a lot if you actually use square-df-int a lot.

Can it inline if a function is used as a functional argument, rather
than directly?  i.e., will inlining help with

(map 'vector #'square-df-int orig-vector)

> Step 1: profile the code.
> Step 2: Look at the hotspots and see what the compiler notes say about
>         those functions.
> Step 3: Add declarations, inline things, change algorithms, etc.

Yeah, it's tough to profile the code.  I can only profile on
relatively small examples, since I'm often consing gigabytes of
memory, and then the profiler crashes.

But I do understand the premise.  It's the mechanics I'm trying to get
to grips with.  I did profile the code (on a smallish example).  The
single most time consuming function was square.  So I started adding
declarations, and didn't get much speedup.  Which is when I asked for
help.

> Anyway, that's how I optimize my Lisp programs.

Yeah, I doubt there's any other way.

Thanks,

rif

Reply via email to