registry: optimize object marshaling #44

Merged
fyrchik merged 1 commits from fyrchik/xk6-frostfs:optimize-registry into master 2023-07-26 21:08:03 +00:00

Close #42

Tested with 40M objects and 15G database, from >100s to setup to <1s, I expect it to work similarly for bigger databases.

Close #42 Tested with 40M objects and 15G database, from >100s to setup to <1s, I expect it to work similarly for bigger databases.
ale64bit reviewed 2023-03-24 07:02:09 +00:00
@ -0,0 +103,4 @@
func randString(n int) string {
var sb strings.Builder
for i := 0; i < n; i++ {
sb.WriteRune('a' + rune(rand.Int())%('z'-'a'))
Collaborator

not that it matters, but this never generates 'z'.

not that it matters, but this never generates 'z'.
Poster
Owner

Fixed

Fixed
fyrchik marked this conversation as resolved
fyrchik force-pushed optimize-registry from 7133400b50 to 8ca052084c 2023-03-24 12:29:00 +00:00 Compare
fyrchik changed title from WIP: registry: optimize object marshaling to registry: optimize object marshaling 2023-03-24 12:29:10 +00:00
fyrchik requested review from storage-core-developers 2023-03-24 12:31:01 +00:00
fyrchik requested review from storage-core-committers 2023-03-24 12:31:01 +00:00
fyrchik requested review from storage-services-committers 2023-03-24 12:31:06 +00:00
fyrchik requested review from storage-services-developers 2023-03-24 12:31:07 +00:00
fyrchik requested review from abereziny 2023-03-24 12:31:18 +00:00
vdomnich-yadro approved these changes 2023-03-24 12:58:22 +00:00
vdomnich-yadro left a comment
Collaborator

Overall looks good, just some thoughts/observations.

Overall looks good, just some thoughts/observations.
@ -0,0 +42,4 @@
o.PayloadHash = r.ReadString()
}
func (o *ObjectInfo) decodeFiltered(r *io.BinReader) {

It took a bit of code reading to figure out what this function does. I can think of two things that might help a code reader:

  1. Either add a comment like // decodeFiltered decodes only those fields that are used in object filtering (for the sake of optimization).
  2. Or maybe rename function to decodeFilterableFields and probably it will be sufficient without the comment.
It took a bit of code reading to figure out what this function does. I can think of two things that might help a code reader: 1. Either add a comment like `// decodeFiltered decodes only those fields that are used in object filtering (for the sake of optimization).` 2. Or maybe rename function to `decodeFilterableFields` and probably it will be sufficient without the comment.
Poster
Owner

Fixed

Fixed
@ -164,12 +175,13 @@ func (o *ObjSelector) selectLoop() {
}
func (f *ObjFilter) match(o ObjectInfo) bool {
//fmt.Printf("filter '%s', object '%s'\n", f.Status, o.Status)

Looks like temp code for debuggins. Should we just remove it?

Looks like temp code for debuggins. Should we just remove it?
Poster
Owner

Fixed

Fixed
@ -165,3 +176,4 @@
func (f *ObjFilter) match(o ObjectInfo) bool {
//fmt.Printf("filter '%s', object '%s'\n", f.Status, o.Status)
if f.Status != "" && f.Status != o.Status {

Do we still need this code here? We already pre-filter objects by status on bucket level, so maybe we can rename the function to filterAge and remove status check from here?

Not a big deal, though...

Do we still need this code here? We already pre-filter objects by status on bucket level, so maybe we can rename the function to `filterAge` and remove status check from here? Not a big deal, though...
Poster
Owner

We don't need it, but I would leave it here: the function could be used in any context and it is easier not to forget something, were we to change something in future.

We don't need it, but I would leave it here: the function could be used in any context and it is easier not to forget something, were we to change something in future.
fyrchik force-pushed optimize-registry from 8ca052084c to cb874098d7 2023-03-27 12:57:21 +00:00 Compare
dstepanov-yadro approved these changes 2023-03-28 06:29:44 +00:00
acid-ant approved these changes 2023-04-03 13:24:52 +00:00
fyrchik force-pushed optimize-registry from cb874098d7 to e71ac35c36 2023-05-15 13:09:43 +00:00 Compare
abereziny approved these changes 2023-05-15 13:11:08 +00:00
fyrchik merged commit e71ac35c36 into master 2023-05-16 12:52:24 +00:00
fyrchik deleted branch optimize-registry 2023-05-16 12:52:27 +00:00
Sign in to join this conversation.
No reviewers
TrueCloudLab/storage-services-committers
No Milestone
No Assignees
6 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: TrueCloudLab/xk6-frostfs#44
There is no content yet.