std::transform performs terribly

Issue #66 resolved
Rob Egan created an issue

profiling the code, reveals the std::tranform ::toupper is a huge bottleneck when reading the contigs file

replace it with something faster

172 while ((len = kseq_read(kseq)) > 0) {
173 if (kseq->name.l > 0 && (!hasABD || inDepth.find(kseq->name.s) != inDepth.end())) {
174 std::transform(kseq->seq.s, kseq->seq.s + len, kseq->seq.s, ::toupper);
175 if (len >= (int) minContig) {
176 contigs[kseq->name.s] = nobs++;
177 contig_names.push_back(kseq->name.s);
178 seqs.push_back(kseq->seq.s);
179 } else if (len >= (int) 1000) {
180 small_contigs[kseq->name.s] = nobs1++;
181 small_contig_names.push_back(kseq->name.s);
182 small_seqs.push_back(kseq->seq.s);
183 }

Comments (1)

  1. Log in to comment