From a0014ac62aeadefe8257ce8bc1e43e47f6ceab0e Mon Sep 17 00:00:00 2001 From: Veronique Legrand <veronique.legrand@pasteur.fr> Date: Thu, 10 Apr 2025 14:34:36 +0200 Subject: [PATCH] work in progress; Investigating why it is so slow. --- src/DnaSeqStr.h | 12 ++++++++---- src/fqwriter.cpp | 2 +- src/read_utils.cpp | 2 +- src/rock.cpp | 2 +- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/DnaSeqStr.h b/src/DnaSeqStr.h index 5d412e1..b9cb795 100644 --- a/src/DnaSeqStr.h +++ b/src/DnaSeqStr.h @@ -8,8 +8,11 @@ #ifndef DNASEQSTR_H_ #define DNASEQSTR_H_ +#include <iostream> #include "FqConstants.h" +using namespace std; + /* * Here, for performance matters, do not want to have to do a memmove nor strcpy or strcat to extract only DNA sequence for all * the fastq records that we'll have to process (potentially millions). So, use a structure to store start position of DNA sequence in buffer and its length. @@ -23,13 +26,13 @@ class DnaSeqStr { public : - char * fq_record_buf; //[MAX_FQ_RECORD_LENGTH]; + char * const fq_record_buf; //[MAX_FQ_RECORD_LENGTH]; int start_idx; int length; public: - DnaSeqStr() { - fq_record_buf=new char[MAX_FQ_RECORD_LENGTH]; + DnaSeqStr():fq_record_buf(new char[MAX_FQ_RECORD_LENGTH]) { + cout<<"Calling DnaSeqStr constructor"<<endl; length=0; start_idx=0; } @@ -41,7 +44,8 @@ public: } ~DnaSeqStr() { - delete fq_record_buf; + cout<<"Calling DnaSeqStr destructor"<<endl; + delete fq_record_buf[]; } }; diff --git a/src/fqwriter.cpp b/src/fqwriter.cpp index a0e2e09..37045e3 100644 --- a/src/fqwriter.cpp +++ b/src/fqwriter.cpp @@ -24,7 +24,7 @@ #include "srp.h" #include "FqBaseBackend.h" -#define DEBUG +//#define DEBUG #ifdef DEBUG #include <iostream> using namespace std; diff --git a/src/read_utils.cpp b/src/read_utils.cpp index 71f9367..32b9bb1 100644 --- a/src/read_utils.cpp +++ b/src/read_utils.cpp @@ -29,7 +29,7 @@ #include "DnaSeqStr.h" #include "read_utils.h" #include "rock_commons.h" -#define DEBUG +//#define DEBUG #ifdef DEBUG #include <cassert> diff --git a/src/rock.cpp b/src/rock.cpp index 05cf096..652d721 100755 --- a/src/rock.cpp +++ b/src/rock.cpp @@ -47,7 +47,7 @@ using namespace std; -// #define BENCHMARK +#define BENCHMARK #ifdef BENCHMARK #include <sys/time.h> #include <sys/resource.h> -- GitLab