OODB Storage Options and Performance

Chris Muller chris at funkyobjects.org
Thu Apr 14 05:07:31 UTC 2005


> The concern I had was, what happens if I don't re-read the
> root but someone else (another remote user) modifies the contents of
> it. Will I automagically get a refreshed copy of the content or do I
> have to re-read the root? 

Let me be careful to answer this correctly..  yes you will get a refreshed
copy, no you don't have to re-read the root.  :)

commit: [ a domain change ] actually "crosses a transaction boundary" twice. 
Once for the #begin (before the user block) and then once after when it
#commit.  All persistent objects are refreshed on both of those occasions.  If
someone changed the root since your last commit, the change will be visible to
the code in the commit block.

> I was assuming the worse case scenario in
> which remote users are modifying the same data so I was re-fetching the
> latest and freshest copy of it.

Not necessary with Magma, as long as using a commit strategy appropriate to the
application.

> I guess the performance increased by a factor of ~2. Still, slightly
> slower that your results, but much better overall. This is still an
> order of magnitude slower than OmniBase.

Did someone say Omnibase was running single-user?  Also, there's one more
optimization to make to the script; use #commitAndBegin.  (I post it at the
end).  With this I get 

14.925 seconds
commit time: 12.209 seconds

And you could use this type of local-connection directly in the server image,
even if that server image were serving remote clients, although this appears to
still be 5-times slower than Omnibase.  Still, compared to the initial run of
57 seconds, it's illustrative of how much improvement can be had using
different configurations.

> Then I made a couple of
> changes to your script (namely used BTree instead of Dictionary,

Btw, the version you have now was improved nearly 4x in the insertion speed for
MagmaCollections since your test from last week, so hopefully a bit more
tolerable.

> Anyway, I'd be interested in knowing more about my question above
> regarding having to re-read the root every time.

Sorry the documentation is still in transition.  If you have any questions
about Magma, please e-mail me anytime.

 - Chris


time:= Time millisecondsToRun:
[Transcript cr..
"db := MagmaSession hostAddress: #(127 0 0 1) asByteArray port: 51969."
db := MagmaSession openLocal: 'c:\temp\daniel'.
db connectAs: 'dsalama'.
db preferences allowWriteBarrier: true.
db commit:
	[db root at: 'Sequences' put: (Dictionary new)].
base := db root at: 'Sequences'.
db commit:
	[base at: 'CustomerNo' put: 0].
commitTime _ Time millisecondsToRun:
[ db begin.
[0 to: 999 do:
	[:i|
	(i \\ 100) = 0 ifTrue: [Transcript show: '.'].
	nextCustomerNo := (base at: 'CustomerNo') + 1.
	base at: 'CustomerNo' put: nextCustomerNo.
	db commitAndBegin
	].
	db commit] ensure: [db disconnectAndClose]] ].

Transcript cr; show: (time/1000) asFloat; show: ' seconds'.
Transcript cr; show: 'commit time: '; show: (commitTime/1000) asFloat; show: '
seconds'.




More information about the Squeak-dev mailing list