Use unordered_map to store sessions for performance reasons

This commit is contained in:
Tim Wojtulewicz 2021-07-28 14:04:34 -07:00
parent 2a717e05cc
commit e2dc6df8a2
4 changed files with 36 additions and 4 deletions

View file

@ -3,7 +3,7 @@
#pragma once
#include <sys/types.h> // for u_char
#include <map>
#include <unordered_map>
#include <utility>
#include "zeek/Frag.h"
@ -119,7 +119,7 @@ public:
private:
using SessionMap = std::map<detail::Key, Session*>;
using SessionMap = std::unordered_map<detail::Key, Session*, detail::KeyHash>;
// Inserts a new connection into the sessions map. If a connection with
// the same key already exists in the map, it will be overwritten by