OODB Storage Options and Performance
Daniel Salama
dsalama at user.net
Wed Apr 13 03:28:24 UTC 2005
David,
I executed the following:
time:= Time millisecondsToRun:
[Transcript cr..
db := KKDatabase onHost: 'localhost' port: 6100.
db root at: 'Sequences' put: (BTree new).
db commit.
base := db root at: 'Sequences'.
nextCustomerNo := base at: 0 ifAbsent: [0].
[0 to: 999 do:
[:i|
(i \\ 100) = 0 ifTrue: [Transcript show: '.'].
nextCustomerNo := nextCustomerNo + 1.
base at: 0 put: nextCustomerNo.
db commit]] ensure: [db logout]].
Transcript cr; show: (time/1000) asFloat; show: ' seconds'.
db := KKDatabase onHost: 'localhost' port: 6100.
base := db root at: 'Sequences'.
Transcript cr; show: 'Last Customer No: '; show: (base at: 0).
db logout.
The time was 204.789 seconds (about 3 seconds longer than before).
Then, I executed the following, using BTree as the root:
time:= Time millisecondsToRun:
[Transcript cr.
db := KKDatabase onHost: 'localhost' port: 6100.
db root: BTree new.
db commit.
db root at: 0 put: (Dictionary new).
db commit.
base := db root at: 0.
nextCustomerNo := base at: 'CustomerNo' ifAbsent: [0].
[0 to: 999 do:
[:i|
(i \\ 100) = 0 ifTrue: [Transcript show: '.'].
nextCustomerNo := nextCustomerNo + 1.
base at: 'CustomerNo' put: nextCustomerNo.
db commit]] ensure: [db logout]].
Transcript cr; show: (time/1000) asFloat; show: ' seconds'.
db := KKDatabase onHost: 'localhost' port: 6100.
base := db root at: 0.
Transcript cr; show: 'Last Customer No: '; show: (base at:
'CustomerNo').
db logout.
And the time was 206.236 seconds. Things seem to be getting worse. Then
I executed this, using BTree for all:
time:= Time millisecondsToRun:
[Transcript cr.
db := KKDatabase onHost: 'localhost' port: 6100.
db root: BTree new.
db commit.
db root at: 0 put: (BTree new).
db commit.
base := db root at: 0.
nextCustomerNo := base at: 0 ifAbsent: [0].
[0 to: 999 do:
[:i|
(i \\ 100) = 0 ifTrue: [Transcript show: '.'].
nextCustomerNo := nextCustomerNo + 1.
base at: 0 put: nextCustomerNo.
db commit]] ensure: [db logout]].
Transcript cr; show: (time/1000) asFloat; show: ' seconds'.
db := KKDatabase onHost: 'localhost' port: 6100.
base := db root at: 0.
Transcript cr; show: 'Last Customer No: '; show: (base at: 0).
db logout.
And the time was 203.232. At last, I did everything at the root as a
BTree, as follows:
time:= Time millisecondsToRun:
[Transcript cr.
db := KKDatabase onHost: 'localhost' port: 6100.
db root: BTree new.
db commit.
nextCustomerNo := 0.
db root at: 0 put: nextCustomerNo.
db commit.
base := db root at: 0.
[0 to: 999 do:
[:i|
(i \\ 100) = 0 ifTrue: [Transcript show: '.'].
nextCustomerNo := nextCustomerNo + 1.
db root at: 0 put: nextCustomerNo.
db commit]] ensure: [db logout]].
Transcript cr; show: (time/1000) asFloat; show: ' seconds'.
db := KKDatabase onHost: 'localhost' port: 6100.
base := db root at: 0.
Transcript cr; show: 'Last Customer No: '; show: base.
db logout.
And the time was 203.086 seconds. Hardly any difference.
Then, just out of curiosity, I started GOODS in a remote server, whose
average latency is 75 ms and the same code executed in 314.65 seconds.
Comments?
Thanks,
Daniel
On Apr 12, 2005, at 6:40 PM, David Shaffer wrote:
> Daniel Salama wrote:
>
>> The GOODS code looked like this:
>>
>> time:= Time millisecondsToRun:
>> [Transcript cr..
>> db := KKDatabase onHost: 'localhost' port: 6100.
>> db root at: 'Sequences' put: (Dictionary new).
>> db commit.
>> base := db root at: 'Sequences'.
>> nextCustomerNo := base at: 'CustomerNo' ifAbsent: [0].
>> [0 to: 999 do:
>> [:i|
>> (i \\ 100) = 0 ifTrue: [Transcript show: '.'].
>> nextCustomerNo := nextCustomerNo + 1.
>> base at: 'CustomerNo' put: nextCustomerNo.
>> db commit]] ensure: [db logout]].
>>
>> Transcript cr; show: (time/1000) asFloat; show: ' seconds'.
>>
>> db := KKDatabase onHost: 'localhost' port: 6100.
>> base := db root at: 'Sequences'.
>> Transcript cr; show: 'Last Customer No: '; show: (base at:
>> 'CustomerNo').
>> db logout.
>>
>>
> Daniel,
>
> Would you mind re-running the above test with a BTree instead of a
> Dictionary as the root? I'm just curious if it has any impact.
>
> David
More information about the Squeak-dev
mailing list
|