From edfc98c2fda5110014138f7cfa81e43cf6b75f69 Mon Sep 17 00:00:00 2001 From: Camille Scott Date: Wed, 13 Sep 2017 15:30:01 -0700 Subject: [PATCH 1/5] Swap to unordered maps where able, for speed --- include/oxli/oxli.hh | 19 ++++++++++--------- include/oxli/storage.hh | 3 ++- khmer/_oxli/oxli_types.pxd | 11 ++++++----- tests/test_subset_graph.py | 2 ++ 4 files changed, 20 insertions(+), 15 deletions(-) diff --git a/include/oxli/oxli.hh b/include/oxli/oxli.hh index 1d3a074f9c..1acd65da24 100644 --- a/include/oxli/oxli.hh +++ b/include/oxli/oxli.hh @@ -71,6 +71,7 @@ private:\ #include #include +#include #include #include #include @@ -129,22 +130,22 @@ typedef void (*CallbackFn)(const char * info, void * callback_data, typedef unsigned int PartitionID; typedef std::set SeenSet; typedef std::set PartitionSet; -typedef std::map PartitionMap; -typedef std::map PartitionPtrMap; -typedef std::map PartitionsToTagsMap; +typedef std::unordered_map PartitionMap; +typedef std::unordered_map PartitionPtrMap; +typedef std::unordered_map PartitionsToTagsMap; typedef std::set PartitionPtrSet; -typedef std::map ReversePartitionMap; +typedef std::unordered_map ReversePartitionMap; typedef std::queue NodeQueue; -typedef std::map PartitionToPartitionPMap; -typedef std::map TagCountMap; -typedef std::map PartitionCountMap; +typedef std::unordered_map PartitionToPartitionPMap; +typedef std::unordered_map TagCountMap; +typedef std::unordered_map PartitionCountMap; typedef std::map PartitionCountDistribution; // types used in @camillescott's sparse labeling extension typedef unsigned long long int Label; -typedef std::multimap TagLabelMap; -typedef std::multimap LabelTagMap; +typedef std::unordered_multimap TagLabelMap; +typedef std::unordered_multimap LabelTagMap; typedef std::pair TagLabelPair; typedef std::pair LabelTagPair; typedef std::set