Skip to content

Commit

Permalink
Reduce memory usage when indexing
Browse files Browse the repository at this point in the history
A full copy of each reference sequence was inadvertently made in each worker
thread.

Reduces memory usage, especially when indexing in parallel.

For 8 threads and when indexing rye, memory usage is reduced
from 35.2 GiB to 33.4 GiB.
  • Loading branch information
marcelm committed Sep 27, 2023
1 parent 9b95973 commit 18967b9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ void StrobemerIndex::assign_all_randstrobes(const std::vector<uint64_t>& randstr
* vector starting from the given offset
*/
void StrobemerIndex::assign_randstrobes(size_t ref_index, size_t offset) {
auto seq = references.sequences[ref_index];
auto& seq = references.sequences[ref_index];
if (seq.length() < parameters.randstrobe.w_max) {
return;
}
Expand Down

0 comments on commit 18967b9

Please sign in to comment.