I am sure that I have read about how to create your own profiler with
Lisp's build in features. I was sure OnLisp was where I read it, but I
can't find it.
I tried my own version, but I'm having problems replacing the function
FOO with a function that times how long FOO took to run.
I'm doing this with ECL, which says it has a profiler - but doesn't
look like works anymore.
Any tips on how to do this, or where I read about the roll your own
profiler?
Cheers
Brad
You could also look at the generic common lisp metering code:
http://www-cgi.cs.cmu.edu/afs/cs/project/ai-repository/ai/lang/lisp/code/tools/metering/metering.cl
--
Thomas A. Russ, USC/Information Sciences Institute
Thomas A. Russ wrote:
> You could also look at the generic common lisp metering code:
>
> http://www-cgi.cs.cmu.edu/afs/cs/project/ai-repository/ai/lang/lisp/code/tools/metering/metering.cl
>
> --
> Thomas A. Russ, USC/Information Sciences Institute
Thanks for the link, I found that and cribbed some code to understand
the wrapping - the whole thing was a bit too much for what I wanted.
Cheers
Brad
"bradb" <··············@gmail.com> writes:
> I am sure that I have read about how to create your own profiler with
> Lisp's build in features. I was sure OnLisp was where I read it, but I
> can't find it.
Norvig's book "Paradigms of AI Programming" briefly covers this.
Paolo
--
Why Lisp? http://wiki.alu.org/RtL%20Highlight%20Film
The Common Lisp Directory: http://www.cl-user.net
Paolo Amoroso wrote:
> "bradb" <··············@gmail.com> writes:
>
> > I am sure that I have read about how to create your own profiler with
> > Lisp's build in features. I was sure OnLisp was where I read it, but I
> > can't find it.
>
> Norvig's book "Paradigms of AI Programming" briefly covers this.
>
>
> Paolo
> --
> Why Lisp? http://wiki.alu.org/RtL%20Highlight%20Film
> The Common Lisp Directory: http://www.cl-user.net
Ah, I knew I read it somewhere. I'll have to dig out my copy of PAIP.
Cheers
Brad
bradb wrote:
> Paolo Amoroso wrote:
> > "bradb" <··············@gmail.com> writes:
> >
> > > I am sure that I have read about how to create your own profiler with
> > > Lisp's build in features. I was sure OnLisp was where I read it, but I
> > > can't find it.
> >
> > Norvig's book "Paradigms of AI Programming" briefly covers this.
> >
> >
> > Paolo
> > --
> > Why Lisp? http://wiki.alu.org/RtL%20Highlight%20Film
> > The Common Lisp Directory: http://www.cl-user.net
>
> Ah, I knew I read it somewhere. I'll have to dig out my copy of PAIP.
For the sake of completeness, the big problem I was having was wrapping
the original function and renaming the original symbol. The following
solution could be used:
(defun make-wrapper (fn)
#'(lambda (&rest args)
(format t "Wrapper is called~%")
(apply fn args)))
(defun wrap-fun (fn-name)
(setf (symbol-function fn-name) (make-wrapper (symbol-function
fn-name))))
Cheers
Brad