From: Olivier Goffart Date: Sat, 23 Sep 2017 11:49:30 +0000 (+0200) Subject: csync: use a unordered_map for the FileMap X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~701^2~48 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=5fc864adb68a3c078d1ebc9cbf11fca440d3e93a;p=nextcloud-desktop.git csync: use a unordered_map for the FileMap Saves more than 10% of csync_update on LargeSyncBench --- 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);