storj/storage
paul cannon ed7c82439d storage/filestore: avoid stat() during walkNamespaceInPath
Calling stat() (really, lstat()) on every file during a directory walk
is the step that takes up the most time. Furthermore, not all directory
walk uses _need_ to have a stat done on every file. Therefore, in this
commit we avoid doing the stat at the lowest level of
walkNamespaceInPath. The stat will still be done when it is requested,
with the Stat() method on the blobInfo object.

The major upside of this is that we can avoid the stat call on most
files during a Retain operation. This should speed up garbage collection
considerably.

The major downside is that walkNamespaceInPath will no longer
automatically skip over directories that are named like blob files, or
blob files which are deleted between readdir() and stat(). Callers to
walkNamespaceInPath and its variants (WalkNamespace,
WalkSatellitePieces, etc) are now expected to handle these cases
individually.

Thanks to forum member Toyoo for the insight that this would speed up
garbage collection.

Refs: https://github.com/storj/storj/issues/5454
Change-Id: I72930573d58928fa25057ed89cd4ec474b884199
2023-01-30 13:47:03 +00:00
..
boltdb all: replace deprecated ioutil 2022-10-31 15:50:41 +00:00
filestore storage/filestore: avoid stat() during walkNamespaceInPath 2023-01-30 13:47:03 +00:00
redis all: fix error naming 2021-04-29 15:38:21 +03:00
storelogger all: fix dots 2020-07-16 14:58:28 +00:00
teststore all: fix dots 2020-07-16 14:58:28 +00:00
testsuite ci: optimize benchmarks 2021-10-08 19:42:40 +03:00
blob.go satellite/audit,storage: increase sleep delay in TestMaxVerifyCount 2021-09-10 15:30:37 +00:00
common.go all: fix linter complaints 2020-10-13 15:59:01 +03:00
listkeys.go storage: delete unused code and lower visibility of static iterator 2020-02-17 14:53:54 +00:00
listv2.go satellite/metainfo: avoid temporary list 2020-04-15 08:01:42 +00:00
util.go ci: fix lint errors 2021-05-17 13:37:31 +00:00