OODB Storage Options and Performance

Chris Muller chris at funkyobjects.org
Wed Apr 13 23:16:27 UTC 2005


Daniel, if you trying to evaluate for potential application performance you
probably want to isolate the portions that are important to you and time them
individually.  What if one db takes 15 seconds to connect, 15 to disconnect,
but can do all the commits in 1 second for total of 31 seconds.  And another db
connects and disconnects in 5 seconds but takes 10 seconds to do the commits. 
The results would show the second one as the "faster" choice, but since
connecting is probably done infrequently compared to commits, it may skew your
interpretation of the results.

You also probably want to know how fast each option *can* go with the
inefficiencies removed from the bench-script.  This script is retrieving the
root over and over again unnecessarily.  Remember, with Magma you have a "live"
view of the db so you don't need to keep getting the root to have the latest
data, all objects are refreshed on every transaction boundary.

> The Magma code looked like this:
> 
> time:= Time millisecondsToRun:
> [Transcript cr..
> db := MagmaSession hostAddress: #(127 0 0 1) asByteArray port: 51969.
> db connectAs: 'dsalama'.

Ok, just for a baseline, when I run this exact script on my computer I get
57.182 seconds; so my 1.3GHz Thinkpad with 768MB RAM must be just a little
faster than your Powerbook G4 1.5GHz with 1GB RAM.

The timing on my machine when not retrieving the root unnecessarily is 51.097
seconds, so not a lot faster.

However, turning on WriteBarrier, the results are considerably better, 30.505
seconds.  Here's script modified which gives this result:

time:= Time millisecondsToRun:
[Transcript cr..
db := MagmaSession hostAddress: #(127 0 0 1) asByteArray port: 51969.
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:
[ [0 to: 999 do:
	[:i|
	(i \\ 100) = 0 ifTrue: [Transcript show: '.'].
	nextCustomerNo := (base at: 'CustomerNo') + 1.
	db commit: [base at: 'CustomerNo' put: nextCustomerNo].
	]] ensure: [db disconnect]] ].

Transcript cr; show: (time/1000) asFloat; show: ' seconds'.
Transcript cr; show: 'commit time: '; show: (commitTime/1000) asFloat; show: '
seconds'.
db := MagmaSession hostAddress: #(127 0 0 1) asByteArray port: 51969.
db connectAs: 'dsalama'.
base := db root at: 'Sequences'.
Transcript cr; show: 'Last Customer No: '; show: (base at:  
'CustomerNo').
db disconnect.



 - Chris



More information about the Squeak-dev mailing list