[Openmcl-devel] Type-of and positive/negative integers
daniel at turtleware.eu
Thu Oct 24 23:55:49 PDT 2019
If you look for something simple like 'time' there is a system
"metering" on quicklisp (written by Mark Kantrowitz around the time when
I was born :-)
Since it uses only CL things it should work on MS Windows too. It works
by hijacking function definitions to trace how long they take and how
much they cons. See the readme for more details.
Steven Nunez writes:
> Thanks everyone for the excellent suggestions. I think I've got enough to go off and experiment with. Now, does anyone know of a good profiling tool that works on MS Windows?
> - SBCL has what I need, but Windows support has always been problematic, and neither sb-profile nor sb-sprof work on Windows.
> - CCL has sam, but it only works on MacOS; the other CCL profilers appear to have bit-rot, or are Linux-specific.
> - Metering seems to be the best option I've found so far, but lacks CPU monitoring, and there doesn't appear to be a way to get the raw data, only the provided statistical summaries.
> Actually the time macro would be useful for this kind of profiling if it returned something useful in the second value, like a struct containing all the information it prints. I might try modifying that if nothing else turns up.
> Does anyone know of a profiler that works on MS Windows?
> On Thursday, October 24, 2019, 10:46:57 PM GMT+8, Tim Bradshaw <tfb at tfeb.org> wrote:
> On 24 Oct 2019, at 14:06, Steven Nunez <steve_nunez at yahoo.com> wrote:
> (deftype simple-double-float-vector (&optional (length '*))
> "Simple vector of double-float elements."
> `(simple-array double-float (,length)))
> One trick you could do to make claims about types which should be checked fairly fast (but, don't do this in an inner loop), if you have a list of things all of which you want to be of some good type, is
> (coerce list-of-things '(vector good-type))
> And then write inner loops which assume suitable vectors of good-type objects.
> This has one nice property and one nasty one. The nice property is that (coerce (coerce something a-type) a-type) only conses one instance of a-type, so you can write functions which take either lists of elements or things you've already turned into vectors.
> The nasty property is that you have to be aware of upgraded-array-element-type and in particular it does not have to be the case that (coerce '(1 2 3) '(vector fixnum)) returns a vector of fixnums: it could easily return a vector of machine integers, which will be bigger than fixnums.
> --tim _______________________________________________
> Openmcl-devel mailing list
> Openmcl-devel at clozure.com
Daniel Kochmański ;; aka jackdaniel | Przemyśl, Poland
TurtleWare - Daniel Kochmański | www.turtleware.eu
"Be the change that you wish to see in the world." - Mahatma Gandhi
More information about the Openmcl-devel