-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #85 from sebastianconcept/84-Add-UnQLite-as-backen…
…d-option 84 add un q lite as backend option
- Loading branch information
Showing
22 changed files
with
1,734 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
148 changes: 148 additions & 0 deletions
148
src/Mapless-Benchmark-Core/MaplessUnQLiteBenchmark.class.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,148 @@ | ||
Class { | ||
#name : #MaplessUnQLiteBenchmark, | ||
#superclass : #Object, | ||
#category : #'Mapless-Benchmark-Core' | ||
} | ||
|
||
{ #category : #actions } | ||
MaplessUnQLiteBenchmark class >> runOn: aMaplessRepository [ | ||
self runOn: aMaplessRepository printingOn: Stdio stdout | ||
] | ||
|
||
{ #category : #actions } | ||
MaplessUnQLiteBenchmark class >> runOn: aMaplessRepository printingOn: aStream [ | ||
aStream | ||
lf; | ||
cr; | ||
lf; | ||
cr; | ||
nextPutAll: 'Benchmarking Mapless on UnQLite...'; | ||
lf; | ||
cr. | ||
self save1KPeopleOn: aMaplessRepository printingOn: aStream. | ||
self save10KPeopleOn: aMaplessRepository printingOn: aStream. | ||
self save1KUsersOn: aMaplessRepository printingOn: aStream. | ||
self save10KUsersOn: aMaplessRepository printingOn: aStream | ||
] | ||
|
||
{ #category : #actions } | ||
MaplessUnQLiteBenchmark class >> save10KPeopleOn: aMaplessRepository printingOn: aStream [ | ||
self save: 10000 peopleOn: aMaplessRepository printingOn: aStream | ||
] | ||
|
||
{ #category : #actions } | ||
MaplessUnQLiteBenchmark class >> save10KUsersOn: aMaplessRepository printingOn: aStream [ | ||
self save: 10000 usersOn: aMaplessRepository printingOn: aStream | ||
] | ||
|
||
{ #category : #actions } | ||
MaplessUnQLiteBenchmark class >> save1KPeopleOn: aMaplessRepository printingOn: aStream [ | ||
self save: 1000 peopleOn: aMaplessRepository printingOn: aStream | ||
] | ||
|
||
{ #category : #actions } | ||
MaplessUnQLiteBenchmark class >> save1KUsersOn: aStream [ | ||
self save: 1000 usersOn: aStream | ||
] | ||
|
||
{ #category : #actions } | ||
MaplessUnQLiteBenchmark class >> save1KUsersOn: aMaplessRepository printingOn: aStream [ | ||
self save: 1000 usersOn: aMaplessRepository printingOn: aStream | ||
] | ||
|
||
{ #category : #actions } | ||
MaplessUnQLiteBenchmark class >> save: aQuantity peopleOn: aMaplessRepository printingOn: aStream [ | ||
| firstNames lastNames delay savesPerSecond guysIds readsPerSecond guy totalDelay | | ||
firstNames := OrderedCollection new. | ||
lastNames := OrderedCollection new. | ||
guysIds := OrderedCollection new. | ||
totalDelay := 0. | ||
1 to: aQuantity do: [ :i | | ||
guy := DummyPerson new | ||
firstName: Character alphabet shuffled anyOne asString; | ||
lastName: Character alphabet shuffled anyOne asString; | ||
yourself. | ||
delay := Time | ||
microsecondsToRun: [ aMaplessRepository save: guy. | ||
guysIds add: guy id ]. | ||
totalDelay := totalDelay + delay ]. | ||
savesPerSecond := (1000000 * aQuantity / totalDelay asFloat) | ||
truncated. | ||
aStream | ||
lf; | ||
cr; | ||
nextPutAll: 'Saved '; | ||
nextPutAll: aQuantity asString; | ||
nextPutAll: ' instances of MaplessDummyPerson in: '; | ||
nextPutAll: (totalDelay / 1000) asFloat rounded asString; | ||
nextPutAll: ' ms '; | ||
nextPutAll: '(~' , savesPerSecond asString , ' saves per second)'; | ||
flush. | ||
totalDelay := 0. | ||
guysIds | ||
do: [ :guyId | | ||
delay := Time | ||
microsecondsToRun: [ guy := aMaplessRepository findOne: DummyPerson atId: guyId ]. | ||
totalDelay := totalDelay + delay ]. | ||
readsPerSecond := (1000000 * aQuantity / totalDelay asFloat) | ||
truncated. | ||
aStream | ||
lf; | ||
cr; | ||
nextPutAll: 'Read '; | ||
nextPutAll: aQuantity asString; | ||
nextPutAll: ' instances of MaplessDummyPerson in: '; | ||
nextPutAll: (totalDelay / 1000) asFloat rounded asString; | ||
nextPutAll: ' ms '; | ||
nextPutAll: '(~' , readsPerSecond asString , ' reads per second)'; | ||
flush | ||
] | ||
|
||
{ #category : #actions } | ||
MaplessUnQLiteBenchmark class >> save: aQuantity usersOn: aMaplessRepository printingOn: aStream [ | ||
| guy user userIds delay savesPerSecond readsPerSecond totalDelay | | ||
userIds := OrderedCollection new. | ||
totalDelay := 0. | ||
1 to: aQuantity do: [ :i | | ||
guy := DummyPerson new | ||
firstName: Character alphabet shuffled anyOne asString; | ||
lastName: Character alphabet shuffled anyOne asString; | ||
yourself. | ||
user := DummyUser new | ||
username: guy firstName; | ||
person: guy; | ||
yourself. | ||
delay := Time | ||
microsecondsToRun: [ aMaplessRepository save: user person. | ||
aMaplessRepository save: user ]. | ||
totalDelay := totalDelay + delay. | ||
userIds add: user id ]. | ||
savesPerSecond := (1000000 * aQuantity / totalDelay asFloat) truncated. | ||
aStream | ||
lf; | ||
cr; | ||
nextPutAll: 'Saved '; | ||
nextPutAll: aQuantity asString; | ||
nextPutAll: ' instances of MaplessDummyPerson and MaplessDummyUser in: '; | ||
nextPutAll: (totalDelay / 1000) asFloat rounded asString; | ||
nextPutAll: ' ms '; | ||
nextPutAll: '(~' , savesPerSecond asString , ' saves per second)'; | ||
flush. | ||
totalDelay := 0. | ||
userIds | ||
do: [ :userId | | ||
delay := Time | ||
microsecondsToRun: [ user := aMaplessRepository findOne: DummyUser atId: userId ]. | ||
totalDelay := totalDelay + delay ]. | ||
readsPerSecond := (1000000 * aQuantity / totalDelay asFloat) truncated. | ||
aStream | ||
lf; | ||
cr; | ||
nextPutAll: 'Read '; | ||
nextPutAll: aQuantity asString; | ||
nextPutAll: ' instances of MaplessDummyPerson and MaplessDummyUser in: '; | ||
nextPutAll: (totalDelay / 1000) asFloat rounded asString; | ||
nextPutAll: ' ms '; | ||
nextPutAll: '(~' , readsPerSecond asString , ' reads per second)'; | ||
flush | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...tgres-Core/PostgresCurrentClient.class.st → ...ore/MaplessPostgresCurrentClient.class.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
Class { | ||
#name : #PostgresCurrentClient, | ||
#name : #MaplessPostgresCurrentClient, | ||
#superclass : #DynamicVariable, | ||
#category : #'Mapless-Postgres-Core-Connections' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 0 additions & 13 deletions
13
src/Mapless-Redis-Tests/ManifestMaplessRedisTests.class.st
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.