Slow cache, 25 seconds before anything is printed
Summary
When running any command that creates a pipeline, BuildStream takes 25 seconds before anything happens.
- My cache is 51G.
- I have an NVMe SSD disk.
- It does not matter if I call it again and again.
Steps to reproduce
Just populate the cache. And try to run any command.
What is the current bug behavior?
It takes 25s on a high end desktop.
What is the expected correct behavior?
It should take 250 time less time.
Relevant logs and/or screenshots
Possible fixes
Short term fix
du takes .8 seconds to scan cas, but around 12 seconds to scan extract. Since all files are in extract are also in cas, skipping it would only miss the size of directories, which we would be OK to neglect given the speedup we get.
However we can only do that when #561 (closed) is fixed.
- Get #561 (closed) fixed.
- Skip scanning of
extractdirectory.
Long term fix
Ideally we would do book keeping.
- Fix #573 (closed), we will keep the size in memory and update it incrementally (question do we still need to
statbothcasandextract?) - Fix cache management with multiple instances running concurrently (#585)
- Make sure we share cache size on disk across instances (mmap'ed file?)
Other relevant information
- BuildStream version affected: /milestone %BuildStream_v1.2
Edited by Valentin David