Loading benchmarks.lisp +6 −5 Original line number Diff line number Diff line Loading @@ -29,15 +29,16 @@ do (read-next-object stream))))) (defun identity-test (x &optional (mode :both)) (let ((*packages* (make-s-packages))) (with-packages (when (member mode '(:both :write)) (with-io-file (stream *test-file* :direction :output :size (object-size x)) (write-object x stream)))) (with-packages (let ((*packages* (make-s-packages))) (when (member mode '(:both :read)) (with-io-file (stream *test-file*) (read-next-object stream))))) (read-next-object stream)))))) (defgeneric create-test-object (type &key &allow-other-keys)) Loading disk.lisp +26 −25 Original line number Diff line number Diff line Loading @@ -147,6 +147,10 @@ (defvar *packages* #()) (declaim (vector *packages*)) (defmacro with-packages (&body body) `(let ((*packages* (make-s-packages))) ,@body)) (defun make-s-packages () (make-array 10 :adjustable t :fill-pointer 0)) Loading Loading @@ -583,25 +587,22 @@ (defun read-file (file) (with-io-file (stream file) (unwind-protect (progn (prepare-classes stream) (prepare-classes stream) (loop until (stream-end-of-file-p stream) do (read-next-object stream))) (setf *indexes* #())))) do (read-next-object stream)))) (defun load-data (storage &optional file) (let ((*storage* storage) (*indexes* *indexes*) (*packages* (make-s-packages))) (clear-cashes) (read-file (or file (storage-file *storage*))) (*indexes* *indexes*)) (with-packages (read-file (or file (storage-file *storage*)))) (interlink-all-objects-first-time))) (defun save-data (storage &optional file) (let ((*storage* storage) (*packages* (make-s-packages))) (let ((*storage* storage)) (when (storage-data storage) (with-io-file (stream (or file (storage-file storage)) :direction :output :size (measure-size)) (dump-data stream))))) (with-packages (dump-data stream)))))) storage.lisp +0 −5 Original line number Diff line number Diff line Loading @@ -136,11 +136,6 @@ (standard-instance-access object loc) relation))) ;;; (defun clear-cashes () (setf *read-class-cache* #())) ;;; Data manipulations (defgeneric add (class &rest args)) Loading Loading
benchmarks.lisp +6 −5 Original line number Diff line number Diff line Loading @@ -29,15 +29,16 @@ do (read-next-object stream))))) (defun identity-test (x &optional (mode :both)) (let ((*packages* (make-s-packages))) (with-packages (when (member mode '(:both :write)) (with-io-file (stream *test-file* :direction :output :size (object-size x)) (write-object x stream)))) (with-packages (let ((*packages* (make-s-packages))) (when (member mode '(:both :read)) (with-io-file (stream *test-file*) (read-next-object stream))))) (read-next-object stream)))))) (defgeneric create-test-object (type &key &allow-other-keys)) Loading
disk.lisp +26 −25 Original line number Diff line number Diff line Loading @@ -147,6 +147,10 @@ (defvar *packages* #()) (declaim (vector *packages*)) (defmacro with-packages (&body body) `(let ((*packages* (make-s-packages))) ,@body)) (defun make-s-packages () (make-array 10 :adjustable t :fill-pointer 0)) Loading Loading @@ -583,25 +587,22 @@ (defun read-file (file) (with-io-file (stream file) (unwind-protect (progn (prepare-classes stream) (prepare-classes stream) (loop until (stream-end-of-file-p stream) do (read-next-object stream))) (setf *indexes* #())))) do (read-next-object stream)))) (defun load-data (storage &optional file) (let ((*storage* storage) (*indexes* *indexes*) (*packages* (make-s-packages))) (clear-cashes) (read-file (or file (storage-file *storage*))) (*indexes* *indexes*)) (with-packages (read-file (or file (storage-file *storage*)))) (interlink-all-objects-first-time))) (defun save-data (storage &optional file) (let ((*storage* storage) (*packages* (make-s-packages))) (let ((*storage* storage)) (when (storage-data storage) (with-io-file (stream (or file (storage-file storage)) :direction :output :size (measure-size)) (dump-data stream))))) (with-packages (dump-data stream))))))
storage.lisp +0 −5 Original line number Diff line number Diff line Loading @@ -136,11 +136,6 @@ (standard-instance-access object loc) relation))) ;;; (defun clear-cashes () (setf *read-class-cache* #())) ;;; Data manipulations (defgeneric add (class &rest args)) Loading