[Openmcl-devel] Type-of and positive/negative integers

Steven Nunez steve_nunez at yahoo.com
Thu Oct 24 23:40:50 PDT 2019

 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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.clozure.com/pipermail/openmcl-devel/attachments/20191025/83b109b6/attachment.htm>

More information about the Openmcl-devel mailing list