projects
/
uffi.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
change email delimiters
[uffi.git]
/
benchmarks
/
allocation.lisp
diff --git
a/benchmarks/allocation.lisp
b/benchmarks/allocation.lisp
index 4b24bc71d22ea66fe1f0b040b8c6fdb090c9c9ff..cb8ff42e5e37cf83cf49caf292b609ba20c719bf 100644
(file)
--- a/
benchmarks/allocation.lisp
+++ b/
benchmarks/allocation.lisp
@@
-7,13
+7,10
@@
;;;; Programmer: Kevin M. Rosenberg
;;;; Date Started: Mar 2002
;;;;
;;;; Programmer: Kevin M. Rosenberg
;;;; Date Started: Mar 2002
;;;;
-;;;; $Id
: allocation.lisp,v 1.2 2003/04/29 19:51:20 kevin Exp
$
+;;;; $Id$
;;;;
;;;;
-;;;; This file, part of UFFI, is Copyright (c) 2002 by Kevin M. Rosenberg
+;;;; This file, part of UFFI, is Copyright (c) 2002
-2005
by Kevin M. Rosenberg
;;;;
;;;;
-;;;; UFFI users are granted the rights to distribute and use this software
-;;;; as governed by the terms of the Lisp Lesser GNU Public License
-;;;; (http://opensource.franz.com/preamble.html), also known as the LLGPL.
;;;; *************************************************************************
(declaim (optimize (debug 3) (speed 3) (safety 1) (compilation-speed 0)))
;;;; *************************************************************************
(declaim (optimize (debug 3) (speed 3) (safety 1) (compilation-speed 0)))
@@
-22,7
+19,7
@@
(defun stk-int ()
#+allegro
(defun stk-int ()
#+allegro
- (ff:with-stack-fobject (ptr :int)
+ (ff:with-stack-fobject (ptr :int)
(setf (ff:fslot-value ptr) 0))
#+lispworks
(fli:with-dynamic-foreign-objects ((ptr :int))
(setf (ff:fslot-value ptr) 0))
#+lispworks
(fli:with-dynamic-foreign-objects ((ptr :int))
@@
-66,7
+63,7
@@
#+cmu
(let ((ptr (alien:make-alien (alien:signed 32))))
(declare ;;(type (alien (* (alien:unsigned 32))) ptr)
#+cmu
(let ((ptr (alien:make-alien (alien:signed 32))))
(declare ;;(type (alien (* (alien:unsigned 32))) ptr)
- (dynamic-extent ptr))
+
(dynamic-extent ptr))
(setf (alien:deref ptr) 0)
(alien:free-alien ptr))
#+sbcl
(setf (alien:deref ptr) 0)
(alien:free-alien ptr))
#+sbcl
@@
-91,13
+88,13
@@
#+cmu
(let ((ptr (alien:make-alien (alien:array (alien:signed 32) 10))))
(declare ;;(type (alien (* (alien:unsigned 32))) ptr)
#+cmu
(let ((ptr (alien:make-alien (alien:array (alien:signed 32) 10))))
(declare ;;(type (alien (* (alien:unsigned 32))) ptr)
- (dynamic-extent ptr))
+
(dynamic-extent ptr))
(setf (alien:deref ptr 5) 0)
(alien:free-alien ptr))
#+sbcl
(let ((ptr (sb-alien:make-alien (sb-alien:array (sb-alien:signed 32) 10))))
(declare ;;(type (sb-alien (* (sb-alien:unsigned 32))) ptr)
(setf (alien:deref ptr 5) 0)
(alien:free-alien ptr))
#+sbcl
(let ((ptr (sb-alien:make-alien (sb-alien:array (sb-alien:signed 32) 10))))
(declare ;;(type (sb-alien (* (sb-alien:unsigned 32))) ptr)
- (dynamic-extent ptr))
+
(dynamic-extent ptr))
(setf (sb-alien:deref ptr 5) 0)
(sb-alien:free-alien ptr))
)
(setf (sb-alien:deref ptr 5) 0)
(sb-alien:free-alien ptr))
)
@@
-105,25
+102,25
@@
(defun stk-vs-stat ()
(format t "~&Stack allocation, Integer")
(defun stk-vs-stat ()
(format t "~&Stack allocation, Integer")
- (time (dotimes (i 1000)
- (dotimes (j 1000)
- (stk-int))))
+ (time (dotimes (i 1000)
+
(dotimes (j 1000)
+
(stk-int))))
(format t "~&Static allocation, Integer")
(format t "~&Static allocation, Integer")
- (time (dotimes (i 1000)
- (dotimes (j 1000)
- (stat-int))))
+ (time (dotimes (i 1000)
+
(dotimes (j 1000)
+
(stat-int))))
(format t "~&Stack allocation, Vector")
(format t "~&Stack allocation, Vector")
- (time (dotimes (i 1000)
- (dotimes (j 1000)
- (stk-int))))
+ (time (dotimes (i 1000)
+
(dotimes (j 1000)
+
(stk-int))))
(format t "~&Static allocation, Vector")
(format t "~&Static allocation, Vector")
- (time (dotimes (i 1000)
- (dotimes (j 1000)
- (stat-int))))
+ (time (dotimes (i 1000)
+
(dotimes (j 1000)
+
(stat-int))))
)
(stk-vs-stat)
)
(stk-vs-stat)
-
+