diff options
author | Keith Rothman <537074+litghost@users.noreply.github.com> | 2021-03-01 09:48:29 -0800 |
---|---|---|
committer | Keith Rothman <537074+litghost@users.noreply.github.com> | 2021-03-01 09:55:54 -0800 |
commit | 0afa0da19f26ccda4172358602bd5ae9cd404f6c (patch) | |
tree | 6b0c7926b30ab971860f439abf40b67e66b1beee /common | |
parent | 6ff02248a3f625829c9bd041c369247ee926d8d0 (diff) | |
download | nextpnr-0afa0da19f26ccda4172358602bd5ae9cd404f6c.tar.gz nextpnr-0afa0da19f26ccda4172358602bd5ae9cd404f6c.tar.bz2 nextpnr-0afa0da19f26ccda4172358602bd5ae9cd404f6c.zip |
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>
Diffstat (limited to 'common')
-rw-r--r-- | common/router2.cc | 3 |
1 files changed, 2 insertions, 1 deletions
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 <absl/container/flat_hash_map.h> #include <algorithm> #include <boost/container/flat_map.hpp> #include <chrono> @@ -191,7 +192,7 @@ struct Router2 } } - std::unordered_map<WireId, int> wire_to_idx; + absl::flat_hash_map<WireId, int> wire_to_idx; std::vector<PerWireData> flat_wires; PerWireData &wire_data(WireId w) { return flat_wires[wire_to_idx.at(w)]; } |