Commit 7e61dcdc authored by Ruben Laso Rodríguez's avatar Ruben Laso Rodríguez
Browse files

perf: minor improvements

parent a92e0285
......@@ -280,7 +280,7 @@ namespace migration {
static auto pages_node_map(const std::vector<samples::pebs> & samples) -> umap<addr_t, node_t> {
static size_t last_map_size = 0;
umap<pid_t, set<addr_t>> pid_pages_map;
umap<pid_t, uset<addr_t>> pid_pages_map;
for (const auto & sample : samples) {
if (sample.is_mem_sample()) {
......
......@@ -215,7 +215,7 @@ namespace performance {
class mempages_table {
private:
map<addr_t, memtable_details::row> table_ = {};
fast_umap<addr_t, memtable_details::row> table_ = {};
req_t accesses_ = 0;
lat_t av_latency_ = samples::minimum_latency;
......@@ -262,8 +262,11 @@ namespace performance {
inline void clear_it() {
if (memory_info::fake_thp_enabled()) {
const auto LAST_SIZE = table_.size();
// Clear the table completely
table_.clear();
// Preallocate to save some time
table_.reserve(LAST_SIZE);
} else {
// Clear non-valid contents
std::set<addr_t> to_remove;
......
......@@ -10,5 +10,5 @@
#include "samples.hpp"
namespace samples {
set<pid_t> PIDs_to_filter;
uset<pid_t> PIDs_to_filter;
} // namespace samples
\ No newline at end of file
......@@ -87,7 +87,7 @@ namespace samples {
}
}
extern set<pid_t> PIDs_to_filter;
extern uset<pid_t> PIDs_to_filter;
static constexpr bool filter_by_PIDs = true;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment