bmrlab / gendam

A privacy-first generative DAM
6 stars 1 forks source link

优化 hash,library 采用 uuid,文件采用更短的 hash,在本地 shard 存储 #35

Closed web3nomad closed 1 month ago

web3nomad commented 1 month ago

spacedrive 生成 hash 的算法,看起来更快

https://github.com/spacedriveapp/spacedrive/blob/204c876689dc113713e63acf441a4a1281227a2d/core/src/object/cas.rs#L23

spacedrive 生成 shard 的方法,取 hash 的 0..3,作为子文件夹

https://github.com/spacedriveapp/spacedrive/blob/204c876689dc113713e63acf441a4a1281227a2d/core/src/object/media/old_thumbnail/shard.rs#L10

zhuojg commented 1 month ago

spacedrive 现在应该只有 thumbnails 用到了 sharding

image

我先不改变目录结构,在 filesartifacts 文件夹里都加一下 sharding

当前:

├── artifacts
│   ├── 5adec370b6040f26
│   │   ├── audio.wav
│   │   ├── frames
│   │   │   ├── ...
│   │   ├── thumbnail.jpg
│   │   └── transcript.txt
├── files
│   ├── 5adec370b6040f26
│   └── ...
...

增加 sharding

├── artifacts
│   ├── 5ad
│   │   ├── 5adec370b6040f26
│   │   │   ├── audio.wav
│   │   │   ├── frames
│   │   │   │   ├── ...
│   │   │   ├── thumbnail.jpg
│   │   │   └── transcript.txt
├── files
│   ├── 5ad
│   │   ├── 5adec370b6040f26
│   │   └── ...

TODO

zhuojg commented 1 month ago

当前目录结构

image image