From 5fc864adb68a3c078d1ebc9cbf11fca440d3e93a Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Sat, 23 Sep 2017 13:49:30 +0200 Subject: [PATCH] csync: use a unordered_map for the FileMap Saves more than 10% of csync_update on LargeSyncBench --- src/csync/csync_private.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/csync/csync_private.h b/src/csync/csync_private.h index 9167a53a4..f3398f7a7 100644 --- a/src/csync/csync_private.h +++ b/src/csync/csync_private.h @@ -32,7 +32,8 @@ #ifndef _CSYNC_PRIVATE_H #define _CSYNC_PRIVATE_H -#include +#include +#include #include #include #include @@ -70,7 +71,8 @@ enum csync_replica_e { * @brief csync public structure */ struct OCSYNC_EXPORT csync_s { - class FileMap : public std::map> { + struct FileMapHash { uint operator()(const QByteArray &a) const { return qHash(a); } }; + class FileMap : public std::unordered_map, FileMapHash> { public: csync_file_stat_t *findFile(const QByteArray &key) const { auto it = find(key); -- 2.30.2