[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gcl-devel] Re: random dreaming of faster typing: a subtypep/type-of opt
From: |
Camm Maguire |
Subject: |
[Gcl-devel] Re: random dreaming of faster typing: a subtypep/type-of optimizer |
Date: |
14 Nov 2005 09:49:19 -0500 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 |
Greetings!
Robert Boyer <address@hidden> writes:
> > I think what you want to expand thus is
> > (typep x '(or cons symbol string))
>
> You're obviously right.
>
> > BTW, any feeling yet on the potential of the fork-based parallelism
> > for the kinds of things you all might be interested in?
>
> So far, I think that your fork-based parallelism is awesome. I haven't tried
> yet to use it for, say, automated reasonsing but expect that I will use it a
> lot. Being able to do the multiple simultaneous compilations made a believer
> of me. Just now I'm back to hacking mainly with uses of hash table stuff.
> Having the huge "static" image is a wonderful testing ground for some
> humungous biological trees.
>
> Thanks so much,
And thank you for the feedback! (I haven't forgotten about the static
function cleanup -- hopefully soon).
BTW, some fun with the latest compiler macros:
=============================================================================
address@hidden:/fix/t1/camm/debian/gcl/tmp/tmp/foo1/unixport$ ./saved_ansi_gcl
GCL (GNU Common Lisp) 2.7.0 ANSI Nov 14 2005 04:58:10
Source License: LGPL(gcl,gmp,pargcl), GPL(unexec,bfd)
Binary License: GPL due to GPL'ed components: (READLINE BFD UNEXEC)
Modifications of this banner must retain notice of a compatible license
Dedicated to the memory of W. Schelter
Use (help) to get some basic information on how to use GCL.
>(setq a (make-array 2000 :element-type 'unsigned-short) y nil)
(dotimes (i 2000) (setf (aref a i) (random 2000)))
(time (dotimes (i 2000) (reduce '+ a)))
(defun foo (a) (reduce '+ a))
(compile 'foo)
(assert (= (foo a) (reduce '+ a)))
(time (dotimes (i 2000) (foo a)))
(time (dotimes (i 2000) (reduce (lambda (x y)
(declare ((integer 0 2000) x y))
(logand x y)) a :initial-value 0)))
(defun foo (a) (reduce (lambda (x y)
(declare ((integer 0 2000) x y))
(logand x y)) a :initial-value 0))
(compile 'foo)
(assert (= (foo a) (reduce (lambda (x y)
(declare ((integer 0 2000) x y))
(logand x y)) a :initial-value 0)))
(time (dotimes (i 2000) (foo a)))
(setq x (loop for i below 2000 collect (random 2000)) y nil)
(time (dolist (l x) (position l x)))
(defun foo (x y) (position x y))
(compile 'foo)
(dolist (l x) (assert (= (position l x) (foo l x))))
(time (dolist (l x) (foo l x)))
(time (dolist (l x) (count-if (lambda (z) (< z l)) x)))
(defun foo (l x) (count-if (lambda (z) (< z l)) x))
(compile 'foo)
(dolist (l x) (assert (= (count-if (lambda (z) (< z l)) x) (foo l x))))
(time (dolist (l x) (foo l x)))
NIL
>
NIL
>
real time : 0.760 secs
run-gbc time : 0.760 secs
child run time : 0.000 secs
gbc time : 0.000 secs
NIL
>
FOO
>
;; Compiling ./gazonk0.lsp.
;; End of Pass 1.
;; End of Pass 2.
;; OPTIMIZE levels: Safety=0 (No runtime error checking), Space=0, Speed=3,
(Debug quality ignored)
;; Finished compiling ./gazonk0.o.
Loading /fix/t1/camm/debian/gcl/tmp/tmp/foo1/unixport/gazonk0.o
start address -T 0x855a20 Finished loading
/fix/t1/camm/debian/gcl/tmp/tmp/foo1/unixport/gazonk0.o
#<compiled-function FOO>
NIL
NIL
>
NIL
>
real time : 0.090 secs
run-gbc time : 0.090 secs
child run time : 0.000 secs
gbc time : 0.000 secs
NIL
>
real time : 3.220 secs
run-gbc time : 2.420 secs
child run time : 0.000 secs
gbc time : 0.740 secs
NIL
>
FOO
>
;; Compiling ./gazonk0.lsp.
;; End of Pass 1.
;; End of Pass 2.
;; OPTIMIZE levels: Safety=0 (No runtime error checking), Space=0, Speed=3,
(Debug quality ignored)
;; Finished compiling ./gazonk0.o.
Loading /fix/t1/camm/debian/gcl/tmp/tmp/foo1/unixport/gazonk0.o
start address -T 0x856930 Finished loading
/fix/t1/camm/debian/gcl/tmp/tmp/foo1/unixport/gazonk0.o
#<compiled-function FOO>
NIL
NIL
>
NIL
>
real time : 0.050 secs
run-gbc time : 0.050 secs
child run time : 0.000 secs
gbc time : 0.000 secs
NIL
>
NIL
>
real time : 5.710 secs
run-gbc time : 5.700 secs
child run time : 0.000 secs
gbc time : 0.000 secs
NIL
>
FOO
>
;; Compiling ./gazonk0.lsp.
;; End of Pass 1.
;; End of Pass 2.
;; OPTIMIZE levels: Safety=0 (No runtime error checking), Space=0, Speed=3,
(Debug quality ignored)
;; Finished compiling ./gazonk0.o.
Loading /fix/t1/camm/debian/gcl/tmp/tmp/foo1/unixport/gazonk0.o
start address -T 0x8547b0 Finished loading
/fix/t1/camm/debian/gcl/tmp/tmp/foo1/unixport/gazonk0.o
#<compiled-function FOO>
NIL
NIL
>
NIL
>
real time : 0.050 secs
run-gbc time : 0.050 secs
child run time : 0.000 secs
gbc time : 0.000 secs
NIL
>
real time : 30.530 secs
run-gbc time : 30.250 secs
child run time : 0.000 secs
gbc time : 0.250 secs
NIL
>
FOO
>
;; Compiling ./gazonk0.lsp.
;; End of Pass 1.
;; End of Pass 2.
;; OPTIMIZE levels: Safety=0 (No runtime error checking), Space=0, Speed=3,
(Debug quality ignored)
;; Finished compiling ./gazonk0.o.
Loading /fix/t1/camm/debian/gcl/tmp/tmp/foo1/unixport/gazonk0.o
start address -T 0x86d760 Finished loading
/fix/t1/camm/debian/gcl/tmp/tmp/foo1/unixport/gazonk0.o
#<compiled-function FOO>
NIL
NIL
>
NIL
>
real time : 0.070 secs
run-gbc time : 0.070 secs
child run time : 0.000 secs
gbc time : 0.000 secs
NIL
>=============================================================================
Take care,
>
> Bob
>
>
>
>
--
Camm Maguire address@hidden
==========================================================================
"The earth is but one country, and mankind its citizens." -- Baha'u'llah