I can't delete the efficiency note when compiling the next code :
---------test-notes-2.lisp---------
(defun efficiency-note ()
(declare (optimize (speed 3)))
(do ((i 0 (the fixnum (1+ i))))
((>= i 4))
(declare (fixnum i))
(do ((j 0 (the fixnum (1+ j))))
((>= j 32))
(declare (fixnum j))
(format t "coucou"))))
-----------------------------------
* (compile-file "test-notes-2.lisp")
Python version 1.0, VM version Intel x86 on 24 APR 01 09:46:48 am.
Compiling:
/amd/motodashi/krakatoa/home/dbernier/TER/DEVELOPPEMENT/test-notes-2.lisp
24 APR 01 09:46:44 am
Converted EFFICIENCY-NOTE.
Compiling DEFUN EFFICIENCY-NOTE:
File:
/amd/motodashi/krakatoa/home/dbernier/TER/DEVELOPPEMENT/test-notes-2.lisp
In: DEFUN EFFICIENCY-NOTE
(DO ((I 0 #))
((>= I 4))
(DECLARE (FIXNUM I))
(DO (#) (#) (DECLARE #) (FORMAT T "coucou")))
--> BLOCK LET TAGBODY PSETQ LET
==>
(SETQ I #:G5)
Note: Doing signed word to integer coercion (cost 20), for:
The first argument of CHECK-FIXNUM.
Byte Compiling Top-Level Form:
Compilation unit finished.
1 note
test-notes-2.x86f written.
Compilation finished in 0:00:00.
#p"/amd/motodashi/krakatoa/home/dbernier/TER/DEVELOPPEMENT/test-notes-2.x86f"
T
NIL
*
David Bernier <········@emi.u-bordeaux.fr> writes:
> I can't delete the efficiency note when compiling the next code :
[ This isn't CLISP, but CMUCL ]
> (SETQ I #:G5)
> Note: Doing signed word to integer coercion (cost 20), for:
> The first argument of CHECK-FIXNUM.
CMUCL can do better:
(defun efficiency-note ()
(declare (optimize (speed 3)))
(do ((i 0 (1+ i)))
((>= i 4))
(declare (type (integer 0 5) i))
(do ((j 0 (1+ j)))
((>= j 32))
(declare (type (integer 0 33) j))
(format t "coucou"))))
It might be worth reading the documentation that comes with CMUCL,
which contains a decent-sized section on optimizing code.
Cheers,
Christophe
--
Jesus College, Cambridge, CB5 8BL +44 1223 524 842
(FORMAT T "(·@{~w ········@{~w~^ ~})" 'FORMAT T "(·@{~w ········@{~w~^ ~})")