From iso at wemba.edu.pl Fri May 11 18:07:52 2007 From: iso at wemba.edu.pl (iso at wemba.edu.pl) Date: Fri, 11 May 2007 20:07:52 +0200 Subject: [cl-store-devel] Incompatibility with Allegro CL 8.1 Message-ID: <87646zfd3b.fsf@localhost> cl-store_0.7.2 cannot be compiled with Allegro CL 8.1 (currently beta). I have contacted Franz Inc. and was told that the file acl/custom.lisp needs to be changed. Instead of (defvar +single-positive-infinity+ (expt most-positive-single-float 2)) (defvar +single-negative-infinity+ (expt most-negative-single-float 3)) (defvar +single-nan+ (/ +single-negative-infinity+ +single-negative-infinity+)) (defvar +double-positive-infinity+ (expt most-positive-double-float 2)) (defvar +double-negative-infinity+ (expt most-negative-double-float 3)) (defvar +double-nan+ (/ +double-negative-infinity+ +double-negative-infinity+))) the following should be used: (defvar +single-positive-infinity+ excl::*infinity-single*) (defvar +single-negative-infinity+ excl::*negative-infinity-single*) (defvar +single-nan+ excl::*nan-single*) (defvar +double-positive-infinity+ excl::*infinity-double*) (defvar +double-negative-infinity+ excl::*negative-infinity-double*) (defvar +double-nan+ excl::*nan-double*)) cl-store compiles with this change, but I have not tested it extensively. From rosssd at gmail.com Tue May 15 08:31:59 2007 From: rosssd at gmail.com (Sean) Date: Tue, 15 May 2007 09:31:59 +0100 Subject: [cl-store-devel] Incompatibility with Allegro CL 8.1 In-Reply-To: <87646zfd3b.fsf@localhost> References: <87646zfd3b.fsf@localhost> Message-ID: <1179217919.7940.0.camel@deepthought> On Fri, 2007-05-11 at 20:07 +0200, iso at wemba.edu.pl wrote: > cl-store_0.7.2 cannot be compiled with Allegro CL 8.1 (currently > beta). I have contacted Franz Inc. and was told that the file > acl/custom.lisp needs to be changed. Thanks for the patch, I'll take a look at it some time later today. Cheers, Sean. From ctdean at sokitomi.com Thu May 31 00:41:40 2007 From: ctdean at sokitomi.com (Chris Dean) Date: Wed, 30 May 2007 17:41:40 -0700 Subject: [cl-store-devel] Patch to optimize (simple-array (unsigned-byte 8) (*)) Message-ID: Below is a patch to optimize the storage of vectors of type (unsigned-byte 8). For large vectors of this type we get a 75% savings in storage space (that is, if it used to take 4000 bytes to store an array now it will only take about 1000 bytes). Comments welcome. Cheers, Chris Dean Index: default-backend.lisp =================================================================== RCS file: /project/cl-store/cvsroot/cl-store/default-backend.lisp,v retrieving revision 1.39 diff -u -w -r1.39 default-backend.lisp --- default-backend.lisp 26 Jan 2007 15:02:24 -0000 1.39 +++ default-backend.lisp 31 May 2007 00:39:50 -0000 @@ -43,6 +43,7 @@ (defparameter +array-code+ (register-code 19 'array)) (defparameter +simple-vector-code+ (register-code 20 'simple-vector)) (defparameter +package-code+ (register-code 21 'package)) +(defparameter +simple-byte-vector-code+ (register-code 22 'simple-byte-vector)) ;; fast storing for 32 bit ints (defparameter +32-bit-integer-code+ (register-code 24 '32-bit-integer)) @@ -513,9 +514,9 @@ (simple-base-string (store-simple-base-string obj stream)) (simple-string (store-simple-string obj stream)) (simple-vector (store-simple-vector obj stream)) + ((simple-array (unsigned-byte 8) (*)) (store-simple-byte-vector obj stream)) (t (store-array obj stream)))) - (defun store-array (obj stream) (declare (optimize speed (safety 0) (debug 0)) (type array obj)) @@ -563,6 +564,14 @@ (loop for x across obj do (store-object x stream))) +(defun store-simple-byte-vector (obj stream) + (declare (optimize speed (safety 0) (debug 0)) + (type (simple-array (unsigned-byte 8) (*)) obj)) + (output-type-code +simple-byte-vector-code+ stream) + (store-object (length obj) stream) + (loop for x across obj do + (write-byte x stream))) + (defrestore-cl-store (simple-vector stream) (declare (optimize speed (safety 1) (debug 0))) (let* ((size (restore-object stream)) @@ -576,6 +585,19 @@ (setting (aref obj x) (restore-object stream))))) res)) +(defrestore-cl-store (simple-byte-vector stream) + (declare (optimize speed (safety 1) (debug 0))) + (let* ((size (restore-object stream)) + (res (make-array size :element-type '(unsigned-byte 8)))) + (declare (type array-size size)) + (resolving-object (obj res) + (dotimes (i size) + ;; we need to copy the index so that + ;; it's value at this time is preserved. + (let ((x i)) + (setting (aref obj x) (read-byte stream))))) + res)) + ;; Dumping (unsigned-byte 32) for each character seems ;; like a bit much when most of them will be ;; base-chars. So we try to cater for them. From rosssd at gmail.com Thu May 31 10:39:01 2007 From: rosssd at gmail.com (Sean) Date: Thu, 31 May 2007 11:39:01 +0100 Subject: [cl-store-devel] Patch to optimize (simple-array (unsigned-byte 8) (*)) In-Reply-To: References: Message-ID: <1180607941.5215.14.camel@deepthought> On Wed, 2007-05-30 at 17:41 -0700, Chris Dean wrote: > Below is a patch to optimize the storage of vectors of type > (unsigned-byte 8). > > For large vectors of this type we get a 75% savings in storage space > (that is, if it used to take 4000 bytes to store an array now it will > only take about 1000 bytes). > > Comments welcome. Thanks for the patch, I'll check it in sometime in the next day or so. Sean.