SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.
Go blob-storagecloud-drivedistributed-file-systemdistributed-storageerasure-codingfusehadoop-hdfshdfskuberneteslancelancedbobject-storageposixs3s3-storageseaweedfstiered-file-systemvector-search
merge interval now is quite faster with reusing slices
Chris Lu469863f7f07e
diff --git a/weed/filer2/filechunks.go b/weed/filer2/filechunks.goindex 27ff2f461a..473aeb54ef 100644--- a/weed/filer2/filechunks.go+++ b/weed/filer2/filechunks.go@@ -109,7 +109,7 @@ var bufPool = sync.Pool{},}-func mergeIntoVisibles(visibles []*visibleInterval, chunk *filer_pb.FileChunk) (newVisibles []*visibleInterval) {+func mergeIntoVisibles(visibles, newVisibles []*visibleInterval, chunk *filer_pb.FileChunk, ) ([]*visibleInterval) {newV := newVisibleInterval(chunk.Offset,@@ -160,7 +160,7 @@ func mergeIntoVisibles(visibles []*visibleInterval, chunk *filer_pb.FileChunk) (}}- return+ return newVisibles}func nonOverlappingVisibleIntervals(chunks []*filer_pb.FileChunk) (visibles []*visibleInterval) {@@ -169,8 +169,12 @@ func nonOverlappingVisibleIntervals(chunks []*filer_pb.FileChunk) (visibles []*vreturn chunks[i].Mtime < chunks[j].Mtime})+ var newVislbles []*visibleIntervalfor _, chunk := range chunks {- visibles = mergeIntoVisibles(visibles, chunk)+ newVislbles = mergeIntoVisibles(visibles, newVislbles, chunk)+ t := visibles[:0]+ visibles = newVislbles+ newVislbles = t}logPrintf("visibles", visibles)