Use a QMap to avoid using a full hashtable for only a few entries, and
clear the QMap once we're done with the measuring. This saves a few
hundred bytes per job during propagation that would otherwise only be
freed at the end of the sync.
<< _stopWatch.durationOfLap(QLatin1String("ContentChecksum"))
<< _stopWatch.durationOfLap(QLatin1String("TransmissionChecksum"))
<< _item->_requestDuration;
+ // The job might stay alive for the whole sync, release this tiny bit of memory.
+ _stopWatch.reset();
finalize(*_item);
}
#include <QByteArray>
#include <QDateTime>
#include <QElapsedTimer>
-#include <QHash>
+#include <QMap>
namespace OCC {
class OWNCLOUDSYNC_EXPORT StopWatch {
private:
- QHash<QString, quint64> _lapTimes;
+ QMap<QString, quint64> _lapTimes;
QDateTime _startTime;
QElapsedTimer _timer;
public: