From 0afa0da19f26ccda4172358602bd5ae9cd404f6c Mon Sep 17 00:00:00 2001 From: Keith Rothman <537074+litghost@users.noreply.github.com> Date: Mon, 1 Mar 2021 09:48:29 -0800 Subject: Add absl::flat_hash_map. This lowers the CPU cost of using the flat wire map in router2, and should use less memory as well. Signed-off-by: Keith Rothman <537074+litghost@users.noreply.github.com> --- common/router2.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'common') diff --git a/common/router2.cc b/common/router2.cc index abe5f302..2f9f0ac4 100644 --- a/common/router2.cc +++ b/common/router2.cc @@ -27,6 +27,7 @@ */ #include "router2.h" +#include #include #include #include @@ -191,7 +192,7 @@ struct Router2 } } - std::unordered_map wire_to_idx; + absl::flat_hash_map wire_to_idx; std::vector flat_wires; PerWireData &wire_data(WireId w) { return flat_wires[wire_to_idx.at(w)]; } -- cgit v1.2.3