Hi,<br><br>I just started to toy around with cl-prevalence; however I found strange speed issues: <br><br>loading a database from transaction log is way faster than loading it from snapshot.<br><br>I modified one of the test scripts from the cl-prevalence distribution:
<br>
<br>
(require 'asdf)<br>
(require 'cl-prevalence)<br>
(in-package :cl-prevalence)<br>
(defclass numbers ()<br>
((numbers-list :accessor get-numbers-list :initform nil))<br>
(:documentation "Object to hold our list of numbers"))<br>
(defun tx-create-numbers-root (system)<br>
"Transaction function to create a numbers instance as a root object"<br>
(setf (get-root-object system :numbers) (make-instance 'numbers)))<br>
(defun tx-add-number (system number)<br>
"Transaction function to add a number to the numbers list"<br>
(let ((numbers (get-root-object system :numbers)))<br>
(push number (get-numbers-list numbers))))<br>
(defparameter *system-location* (pathname "/tmp/demo1-prevalence-system/")<br>
"Filesystem location of the prevalence system")<br>
(defvar *system* (time (make-prevalence-system *system-location*)) )<br>
(execute *system* (make-transaction 'tx-create-numbers-root))<br>
(time (dotimes (i 100000) (execute *system* (make-transaction 'tx-add-number i))) )<br>
;(time (snapshot *system*))<br>
(close-open-streams *system*)<br>
<br>
<br>
I use this script to create a database; later to load it; then to
snapshot it and load it again (uncommenting the appropriate parts
between the runs).<br>
<br>
Creating and snapshotting is fast; however loading from snapshot is slow.<br>
Times:<br>
creating: 19.89 seconds<br>
loading from transaction log: 53.942 seconds < this is good<br>
snapshotting: 5.297 seconds <br>
loading from snapshot: 182.713 seconds < this is strange <br>
snapshotting again: 1.165 seconds<br>
<br>
Any ideas what this strangeness can be?<br>
<br>
<br>
Gabor <br>