Byron / dua-cli

View disk space usage and delete unwanted data, fast.
https://lib.rs/crates/dua-cli
MIT License
4.19k stars 113 forks source link

Large graphs question #210

Closed gmacon closed 10 months ago

gmacon commented 10 months ago

In the README, you give a known limitation as

In interactive mode, the maximum amount of files is limited to 2^32 - 1 (u32::max_value() - 1) entries.

  • One node is used as to 'virtual' root
  • The actual amount of nodes stored might be lower, as there might be more edges than nodes, which are also limited by a u32 (I guess)
  • The limitation is imposed by the underlying petgraph crate, which declares it as unsafe to use u64 for instance.
  • It's possibly UB when that limit is reached, however, it was never observed either.

I was surprised to read that petgraph doesn't support 64-bit indices, so I went and looked it up. It doesn't support u64, but you can use usize, which isn't quite as good, since you only get 64-bit indices on 64-bit platforms, but it seems to me that that would be the common case. Is there some reason I don't see not to use usize?