[cl-store-devel] ABCL tests
szergling
senatorzergling at gmail.com
Tue Nov 20 01:19:43 UTC 2007
On Nov 18, 2007 2:56 AM, szergling <senatorzergling at gmail.com> wrote:
> On Nov 17, 2007 6:30 AM, Sean Ross <rosssd at gmail.com> wrote:
[[...]]
> > Both of these hash-tables are used to track objects that have already
> > been restored (or stored as the case may be) and integers (and IIRC
> > characters) are not checked for this. Using #'eql for these two tests
> > shouldn't hurt but I feel that using #'eq it makes it clear that it is
> > testing for the `same` object.
>
> Ok, I probably should look at more cases. I had only observed, and
> assumed that keys to the store/restore hash-tables are always integers
> (and hence require hash-table tests to be #'eql). If that were the
> case (that keys are integers), the best test to communicate the
> program's intent would be to make-hash-table with :test #'=, except
> hash tables only portably support :test for "eq, eql, equal, or
> equalp" (default eql).
>
> Re-reading your reply, let me clarify also that I was not referring to
> the test for object identity (values (as opposed to keys) of the
> store/restore hash table).
Thousand apologies!
There has been some confusion here. I have been looking at
cl-store_0.7, so my patches were really outdated. Indeed, in
cl-store_0.8, the #'eql test for the store/restore hash-tables has
been implemented, and I begin to see #+abcl sprinkled about the code,
so my patches were not required.
> > > At the moment, there were quite a few failed tests, and I cannot even
> > > finish large.1
> >
> > I'm not too sure what causes this but I'm assuming that it's some form
> > of unhappiness between ABCL and CL-STORE.
>
> I think it's just because ABCL runs out of memory, so please don't
> read too much into that. I will try a larger heap the next time I get
> around to it.
It looks like a scalability issue, but aside from that, it runs
correctly.
CL-USER> (time (let ((list (make-list 10)))
(setf (cdr (last list)) list)
(cl-store:store list cl-store-tests::*test-file*)
(let ((ret (cl-store:restore cl-store-tests::*test-file*)))
(eq (nthcdr 10 ret) ret))))
0.11 seconds real time
42220 cons cells
T
CL-USER> (time (let ((list (make-list 100)))
(setf (cdr (last list)) list)
(cl-store:store list cl-store-tests::*test-file*)
(let ((ret (cl-store:restore cl-store-tests::*test-file*)))
(eq (nthcdr 100 ret) ret))))
0.547 seconds real time
219689 cons cells
T
CL-USER> (time (let ((list (make-list 1000)))
(setf (cdr (last list)) list)
(cl-store:store list cl-store-tests::*test-file*)
(let ((ret (cl-store:restore cl-store-tests::*test-file*)))
(eq (nthcdr 1000 ret) ret))))
5.078 seconds real time
1993699 cons cells
T
CL-USER> (time (let ((list (make-list 10000)))
(setf (cdr (last list)) list)
(cl-store:store list cl-store-tests::*test-file*)
(let ((ret (cl-store:restore cl-store-tests::*test-file*)))
(eq (nthcdr 10000 ret) ret))))
53.547 seconds real time
19735041 cons cells
T
CL-USER>
As of now, most tests seem to pass, with the exception of packages,
CLOS objects, conditions (they seem to be CLOS objects) and large
objects. However, because I'm using ABCL 0.0.9, I had to workaround an
issue with file compilation and had to load default-backend.lisp
manually. This seems to be related to ABCL's (at least for my version)
lack of support for compilation of certain types of closures.
Cheers, and apologies again.
Final issue: this looks like I got confused with yet another version
of cl-store. cl-store_0.8 seems to ignore the pathname-host.
> PS: I haven't tested this, but is it a bug? Need to swap pathname to
> obj in host-namestring and change (serialize ... to (store-object ...
>
> (defstore-cl-store (obj pathname stream)
> ;; pathname-host code stolen from serialize.lisp in Rucksack.
> ;; Copyright (c) 2006 Arthur Lemmens
>
> ;; PORTABILITY NOTE: This is not necessarily portable. If an implementation
> ;; uses non-serializable objects to represent host or device or directory
> ;; or name or type or version, this will break.
> (output-type-code +pathname-code+ stream)
> #-sbcl(serialize (pathname-host pathname) stream)
> #+sbcl(serialize (host-namestring pathname) stream)
> (store-object (pathname-device obj) stream)
> (store-object (pathname-directory obj) stream)
> (store-object (pathname-name obj) stream)
> (store-object (pathname-type obj) stream)
> (store-object (pathname-version obj) stream))
More information about the cl-store-devel
mailing list