Skip to content

Commit

Permalink
⚡ Improved performance by switching to phmap in more places (#118)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelwa committed Feb 8, 2023
1 parent 384ebe0 commit c57a184
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
#include "fiction/utils/stl_utils.hpp"

#include <mockturtle/utils/stopwatch.hpp>
#include <phmap.h>

#include <algorithm>
#include <cstdint>
#include <optional>
#include <unordered_set>
#include <vector>

#include <combinations.h>
Expand Down Expand Up @@ -246,9 +246,9 @@ class generate_edge_intersection_graph_impl

private:
/**
* Uniquely identify path elements in a set and make them searchable fast.
* Uniquely identify path elements in a set to make them searchable in O(1).
*/
std::unordered_set<coordinate<Lyt>> path_elements{};
phmap::flat_hash_set<coordinate<Lyt>> path_elements{};
};
/**
* Alias for the path type.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include "fiction/traits.hpp"
#include "fiction/utils/routing_utils.hpp"

#include <unordered_set>
#include <phmap.h>

namespace fiction
{
Expand Down Expand Up @@ -58,7 +58,7 @@ class enumerate_all_clocking_paths_impl

enumerate_all_clocking_paths_params ps;

std::unordered_set<coordinate<Lyt>> visited{};
phmap::flat_hash_set<coordinate<Lyt>> visited{};

path_collection<Path> collection{};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ class yen_k_shortest_paths_impl
}

// find an alternative path from the spur coordinate to the target and check that it is not empty
if (auto spur_path =
if (const auto spur_path =
a_star<Path>(layout, {spur, objective.target},
manhattan_distance_functor<obstruction_layout<Lyt>, uint64_t>(),
unit_cost_functor<obstruction_layout<Lyt>, uint8_t>(), ps.astar_params);
Expand Down

0 comments on commit c57a184

Please sign in to comment.