diff --git a/RTCP/Cobalt/CoInterface/src/CorrelatedData.cc b/RTCP/Cobalt/CoInterface/src/CorrelatedData.cc index 093e8638049f0825dfb2baa3eea02095a2dad62b..0f9af504f65e421c16a86ad26063b83b419607bf 100644 --- a/RTCP/Cobalt/CoInterface/src/CorrelatedData.cc +++ b/RTCP/Cobalt/CoInterface/src/CorrelatedData.cc @@ -22,6 +22,7 @@ #include "CorrelatedData.h" #include <Common/LofarLogger.h> +#include <Common/Timer.h> namespace LOFAR { @@ -79,7 +80,10 @@ namespace LOFAR false), itsNrBytesPerNrValidSamples(nrBytesPerNrValidSamples(maxNrValidSamples)) { + NSTimer timer("CorrelatedData::init()", true, true); + timer.start(); init(nrChannels, allocator); + timer.stop(); } diff --git a/RTCP/Cobalt/OutputProc/src/SubbandWriter.cc b/RTCP/Cobalt/OutputProc/src/SubbandWriter.cc index 3f3d1887ff70393ce3ee453588c9440b8c1a8b11..20a616788a319901ae5e18e44e7378420c702878 100644 --- a/RTCP/Cobalt/OutputProc/src/SubbandWriter.cc +++ b/RTCP/Cobalt/OutputProc/src/SubbandWriter.cc @@ -56,9 +56,17 @@ namespace LOFAR itsAllocator = new SparseSetAllocator(*itsArena); + NSTimer timer(str(format("preallocator %u") % itsStreamNr), true, true); + for (unsigned i = 0; i < preAllocateReceiveQueue; i++) { + timer.start(); + + LOG_DEBUG_STR(str(format("[stream %u] Allocating element %u") % itsStreamNr % i)); CorrelatedData *data = new CorrelatedData(itsNrStations, itsNrChannels, itsNrSamples, *itsAllocator, itsAlignment); + LOG_DEBUG_STR(str(format("[stream %u] Appending element %u") % itsStreamNr % i)); itsOutputPool.free.append(data); + + timer.stop(); } } @@ -73,9 +81,14 @@ namespace LOFAR NSTimer timer(str(format("allocator %u") % itsStreamNr), true, true); for (unsigned i = preAllocateReceiveQueue; i < maxReceiveQueueSize; i++) { + timer.start(); + LOG_DEBUG_STR(str(format("[stream %u] Allocating element %u") % itsStreamNr % i)); CorrelatedData *data = new CorrelatedData(itsNrStations, itsNrChannels, itsNrSamples, *itsAllocator, itsAlignment); + LOG_DEBUG_STR(str(format("[stream %u] Appending element %u") % itsStreamNr % i)); itsOutputPool.free.append(data); + + timer.stop(); } } diff --git a/RTCP/Cobalt/OutputProc/src/SubbandWriter.h b/RTCP/Cobalt/OutputProc/src/SubbandWriter.h index c65240167deecc61d7e7ff41e87b68a3dd1719ce..10eaa727098accf096d757b90a19a5acc7197bc9 100644 --- a/RTCP/Cobalt/OutputProc/src/SubbandWriter.h +++ b/RTCP/Cobalt/OutputProc/src/SubbandWriter.h @@ -62,8 +62,8 @@ namespace LOFAR unsigned streamNr() const { return itsStreamNr; } private: - static const unsigned preAllocateReceiveQueue = 4; // number of elements to construct before starting - static const unsigned maxReceiveQueueSize = 60; // number of elements desired in the queue + static const unsigned preAllocateReceiveQueue = 30; // number of elements to construct before starting + static const unsigned maxReceiveQueueSize = 60; // number of elements desired in the queue const unsigned itsStreamNr;