Change AccumulateCursor
to use utils::pmr::deque
(#888)
* Increase performance by eliminating unnecessary `TypedValue` copies
This commit is contained in:
parent
b02b201129
commit
97e250129e
@ -53,6 +53,7 @@
|
|||||||
#include "utils/likely.hpp"
|
#include "utils/likely.hpp"
|
||||||
#include "utils/logging.hpp"
|
#include "utils/logging.hpp"
|
||||||
#include "utils/memory.hpp"
|
#include "utils/memory.hpp"
|
||||||
|
#include "utils/pmr/deque.hpp"
|
||||||
#include "utils/pmr/list.hpp"
|
#include "utils/pmr/list.hpp"
|
||||||
#include "utils/pmr/unordered_map.hpp"
|
#include "utils/pmr/unordered_map.hpp"
|
||||||
#include "utils/pmr/unordered_set.hpp"
|
#include "utils/pmr/unordered_set.hpp"
|
||||||
@ -3248,7 +3249,7 @@ class AccumulateCursor : public Cursor {
|
|||||||
private:
|
private:
|
||||||
const Accumulate &self_;
|
const Accumulate &self_;
|
||||||
const UniqueCursorPtr input_cursor_;
|
const UniqueCursorPtr input_cursor_;
|
||||||
utils::pmr::vector<utils::pmr::vector<TypedValue>> cache_;
|
utils::pmr::deque<utils::pmr::vector<TypedValue>> cache_;
|
||||||
decltype(cache_.begin()) cache_it_ = cache_.begin();
|
decltype(cache_.begin()) cache_it_ = cache_.begin();
|
||||||
bool pulled_all_input_{false};
|
bool pulled_all_input_{false};
|
||||||
};
|
};
|
||||||
|
23
src/utils/pmr/deque.hpp
Normal file
23
src/utils/pmr/deque.hpp
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
// Copyright 2023 Memgraph Ltd.
|
||||||
|
//
|
||||||
|
// Use of this software is governed by the Business Source License
|
||||||
|
// included in the file licenses/BSL.txt; by using this file, you agree to be bound by the terms of the Business Source
|
||||||
|
// License, and you may not use this file except in compliance with the Business Source License.
|
||||||
|
//
|
||||||
|
// As of the Change Date specified in that file, in accordance with
|
||||||
|
// the Business Source License, use of this software will be governed
|
||||||
|
// by the Apache License, Version 2.0, included in the file
|
||||||
|
// licenses/APL.txt.
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <deque>
|
||||||
|
|
||||||
|
#include "utils/memory.hpp"
|
||||||
|
|
||||||
|
namespace memgraph::utils::pmr {
|
||||||
|
|
||||||
|
template <class T>
|
||||||
|
using deque = std::deque<T, utils::Allocator<T>>;
|
||||||
|
|
||||||
|
} // namespace memgraph::utils::pmr
|
Loading…
Reference in New Issue
Block a user