Use a serde
visitor in inspect
to avoid buffering the full database
#27
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi Jim!
In light with the
inspect
release here's a PR to reduce the memory requirements: using aserde::de::Visitor
to visit the database allows to accumulate the stats over theGenomeSketch
without having to deserialize the wholeVec<GenomeSketch>
in memory. This means now you cansylph inspect gtdb-r220-c200-dbv1.syldb
in about the same time but 60MiB of memory. An example for this kind of things can be found here in the serde documentation to process a large JSON file without buffering it first.NB: I was exploring how to do that with the database during the search as well to avoid having to load the full database, so that it could run on more memory-starved systems. What I had so far worked okay for single threads but didn't parallelize well, however that may be a direction worth exploring.