[elephant-devel] Re: Some performance optimizations
Alex Mizrahi
killerstorm at newmail.ru
Sat Dec 15 16:47:28 UTC 2007
> Work on a new cursor implementation is in progress, that
> might come later.
done, at least passes all tests..
of course this new implementation doesn't solve all issues, but at least
cursor operations now do not slow down with table growth, to the extent
PostgreSQL does not.
btw, i've found such test:
(test (map-btree-remove :depends-on (and btree-make btree-cursor map-btree))
(flet ((mapper (k v)
(declare (ignore k))
(when (and (>= (slot1 v) 100) (< (slot1 v) 200))
(remove-current-kv))))
(map-btree #'mapper bt)
seems kinda weird for me -- cursor-delete (which is called from
remove-current-kv) -- leaves cursor uninitialized, so further cursor-next
does cursor-first (looks like it's not documented for Elephant, but that's
the way it works in bdb.
so it starts again from start to reach these deleted values again..
won't it be better to define something like:
(defun remove-current-kv ()
(unless *current-cursor* (error "Cannot call remove-current-kv outside of
a map-btree or map-index function argument"))
(multiple-value-bind (f k v)
(when f
(cursor-current *current-cursor*)
(cursor-delete *current-cursor*)
(cursor-set-range *current-cursor* k))))
?
btw tests helped me debugging thing a lot..
More information about the elephant-devel
mailing list