Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

⚡ Improved performance by switching to phmap in more places #118

Merged
merged 1 commit into from
Feb 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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