Skip to content

Commit

Permalink
src: use unordered_map for perf marks
Browse files Browse the repository at this point in the history
PR-URL: #19558
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
addaleax authored and targos committed Mar 27, 2018
1 parent e533911 commit 780a5d6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/env-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,8 @@ inline performance::performance_state* Environment::performance_state() {
return performance_state_.get();
}

inline std::map<std::string, uint64_t>* Environment::performance_marks() {
inline std::unordered_map<std::string, uint64_t>*
Environment::performance_marks() {
return &performance_marks_;
}

Expand Down
5 changes: 2 additions & 3 deletions src/env.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
#include "node_http2_state.h"

#include <list>
#include <map>
#include <stdint.h>
#include <vector>
#include <unordered_map>
Expand Down Expand Up @@ -642,7 +641,7 @@ class Environment {
inline void set_fs_stats_field_array(double* fields);

inline performance::performance_state* performance_state();
inline std::map<std::string, uint64_t>* performance_marks();
inline std::unordered_map<std::string, uint64_t>* performance_marks();

inline void ThrowError(const char* errmsg);
inline void ThrowTypeError(const char* errmsg);
Expand Down Expand Up @@ -774,7 +773,7 @@ class Environment {
int should_not_abort_scope_counter_ = 0;

std::unique_ptr<performance::performance_state> performance_state_;
std::map<std::string, uint64_t> performance_marks_;
std::unordered_map<std::string, uint64_t> performance_marks_;

#if HAVE_INSPECTOR
std::unique_ptr<inspector::Agent> inspector_agent_;
Expand Down

0 comments on commit 780a5d6

Please sign in to comment.