registry: optimize object marshaling #44
No reviewers
Labels
No labels
P0
P1
P2
P3
good first issue
Infrastructure
blocked
bug
config
discussion
documentation
duplicate
enhancement
go
help wanted
internal
invalid
kludge
observability
perfomance
question
refactoring
wontfix
No milestone
No project
No assignees
6 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: TrueCloudLab/xk6-frostfs#44
Loading…
Reference in a new issue
No description provided.
Delete branch "fyrchik/xk6-frostfs:optimize-registry"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Close #42
Tested with 40M objects and 15G database, from >100s to setup to <1s, I expect it to work similarly for bigger databases.
@ -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'))
not that it matters, but this never generates 'z'.
Fixed
7133400b50
to8ca052084c
WIP: registry: optimize object marshalingto registry: optimize object marshalingOverall 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:
// decodeFiltered decodes only those fields that are used in object filtering (for the sake of optimization).
decodeFilterableFields
and probably it will be sufficient without the comment.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?
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...
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.
8ca052084c
tocb874098d7
cb874098d7
toe71ac35c36