feat(local): add directory size support - #624
Conversation
|
Thank you for your contribution and the detailed explanation!
Because of these concerns, we believe the current approach needs further refinement to balance performance and reliability. We’d suggest:
Or packaging this as an optional setting for users who need it. We really appreciate your effort and welcome further improvements on this feature! |
|
Hello, thanks for the response!
I'm at the concussion that this implementation is already as performant as it can be, it already minimized the calculation which need to be done after the first initialization. As of reliability, I think it can be improved by listening to FS events, but I'm not sure if that work well with OpenList's way of implementing drivers. |
|
Hello, thank you for your contribution |
|
Thanks for the response, do we have any official performance testing methods? Or I just need to test it myself on large amount of files. |
|
Not yet. We will test the impact on performance ourselves. |
dezhishen
left a comment
There was a problem hiding this comment.
尝试使用ide的格式化代码功能,对代码进行格式化。
或者使用go fmt进行格式化
Signed-off-by: 我怎么就不是一只猫呢? <[email protected]>
…endless loop Signed-off-by: 我怎么就不是一只猫呢? <[email protected]>
Signed-off-by: 我怎么就不是一只猫呢? <[email protected]>
|
All review conversations must be marked as resolved before merging. |
|
|
感謝各位大佬的協助! |
* feat(local): add directory size support * fix(local): fix and improve directory size calculation * style(local): fix code style * style(local): fix code style * style(local): fix code style * fix(local): refresh directory size when force refresh Signed-off-by: 我怎么就不是一只猫呢? <[email protected]> * fix:(local): Avoid traversing the parent's parent, which leads to an endless loop Signed-off-by: 我怎么就不是一只猫呢? <[email protected]> * fix(local:) refresh dir size only enabled Signed-off-by: 我怎么就不是一只猫呢? <[email protected]> * fix(local): logical error && add RecalculateDirSize && cleaner code for int64 * feat(local): add Benchmark for CalculateDirSize * refactor(local): 优化移动中对于错误的判断。 --------- Signed-off-by: 我怎么就不是一只猫呢? <[email protected]> Co-authored-by: 我怎么就不是一只猫呢? <[email protected]>
Hello to the OpenList community! This is an attempt to implement directory size for the local driver.
The size of directories are pre-calculated at initialization, and updated when user modify files through OpenList. Because of this if files are modified not using OpenList, the size displayed will likely be incorrect (can be fix by reloading the storage).
I don't know how well this would scale, so by default this option is set to
false.