-
Notifications
You must be signed in to change notification settings - Fork 28
Description
Summary
OpenDAL's Google Drive backend now supports efficient batch recursive listing, improving performance by ~280x compared to the previous implementation. This issue tracks when rustic_core can benefit from this improvement.
Problem
When using rustic with Google Drive via OpenDAL (opendal:gdrive), operations like repoinfo, check, or backup were extremely slow compared to using rclone:gdrive.
Root cause: OpenDAL's generic FlatLister made one API call per directory. For a repository with 256 data/XX/ subdirectories + other dirs, this meant ~260+ sequential API calls.
Solution (implemented in OpenDAL)
A custom GdriveFlatLister was implemented that uses Google Drive's OR query syntax to batch multiple directory lookups:
('id1' in parents or 'id2' in parents or 'id3' in parents ...)
This is the same approach rclone uses for its ListR implementation.
Performance Results
Tested with rustic repoinfo against a real Google Drive repository (~2100 files, 130 GiB):
| Metric | Before | After | Improvement |
|---|---|---|---|
| Scanning time | 14 minutes | 3 seconds | ~280x faster |
| API calls | ~260+ | ~12 | ~20x fewer |
Dependencies
This improvement requires two OpenDAL PRs to be merged and released:
-
fix(services/gdrive): include size and modifiedTime in list() metadata apache/opendal#7058 -
fix(services/gdrive): include size and modifiedTime in list() metadata- Required for rustic to work at all (without this, file sizes are missing)
-
feat(services/gdrive): implement batch recursive listing for ~200x performance improvement apache/opendal#7059 -
feat(services/gdrive): implement batch recursive listing- The performance improvement itself
Timeline
- ⏳ Wait for OpenDAL PRs to be reviewed and merged
- ⏳ Wait for OpenDAL release (0.55.1 or 0.56.0)
- 🔧 Update rustic_core's OpenDAL dependency (see Update OpenDAL integration for 0.55+ (Scheme enum removed) #442 for API changes needed)
- ✅ Benefit from improved Google Drive performance
Related Issues
- Update OpenDAL integration for 0.55+ (Scheme enum removed) #442 - OpenDAL 0.55+ API changes (Scheme enum removed)
- bug: services/gdrive:
list()returns size=0 for all files - missing size field in API call and metadata mapping apache/opendal#7057 - Original bug report for missing metadata - fix(services/gdrive): include size and modifiedTime in list() metadata apache/opendal#7058 - PR fixing metadata
- feat(services/gdrive): implement batch recursive listing for ~200x performance improvement apache/opendal#7059 - PR for batch listing performance
Notes
For users who need this fix now, you can use a patched OpenDAL version by adding to your Cargo.toml:
[patch.crates-io]
opendal = { git = "https://github.com/mro68/opendal", branch = "feat/gdrive-batch-recursive-listing" }This branch includes both the metadata fix and the performance improvement.