[cl-prevalence-devel] Keeping state during transactions

Alexey Voznyuk me at swizard.info
Fri Sep 25 00:28:50 UTC 2009


    Hello!

    I've faced annoying cl-prevalence behavior which I don't know how to 
deal with.

    For example, consider this code that I want to run within a transaction:

(defun tx-add-item (store index item)
  (declare (ignore store))
  (setf (gethash item index) t))

    Current cl-prevalence implementation invokes (reset 
serialization-state) before each (serialize-*) call. So as long as I 
insert new items into the index, each log entry becomes bigger and 
bigger because it needs to deeply serialize "index" parameter with all 
its elements, including the new ones.

    The problem that the index can contains thousands elements, and each 
of them can be a complex object itself with maybe more index tables. In 
such case a single transaction can consume a lot of resource.

    My proposal is to not reset serialization-state before each 
transaction serialize step but to keep it until full snapshot is 
occurred. For me it seems to work correctly, but maybe I miss something? 




More information about the Cl-prevalence-devel mailing list