summaryrefslogtreecommitdiff
path: root/editor/debugger/editor_profiler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/debugger/editor_profiler.cpp')
-rw-r--r--editor/debugger/editor_profiler.cpp44
1 files changed, 19 insertions, 25 deletions
diff --git a/editor/debugger/editor_profiler.cpp b/editor/debugger/editor_profiler.cpp
index 4e2e8634e5..55c3c7af78 100644
--- a/editor/debugger/editor_profiler.cpp
+++ b/editor/debugger/editor_profiler.cpp
@@ -198,18 +198,18 @@ void EditorProfiler::_update_plot() {
for (int i = 0; i < total_metrics; i++) {
const Metric &m = _get_frame_metric(i);
- for (Set<StringName>::Element *E = plot_sigs.front(); E; E = E->next()) {
- const Map<StringName, Metric::Category *>::Element *F = m.category_ptrs.find(E->get());
+ for (RBSet<StringName>::Element *E = plot_sigs.front(); E; E = E->next()) {
+ HashMap<StringName, Metric::Category *>::ConstIterator F = m.category_ptrs.find(E->get());
if (F) {
- highest = MAX(F->get()->total_time, highest);
+ highest = MAX(F->value->total_time, highest);
}
- const Map<StringName, Metric::Category::Item *>::Element *G = m.item_ptrs.find(E->get());
+ HashMap<StringName, Metric::Category::Item *>::ConstIterator G = m.item_ptrs.find(E->get());
if (G) {
if (use_self) {
- highest = MAX(G->get()->self, highest);
+ highest = MAX(G->value->self, highest);
} else {
- highest = MAX(G->get()->total, highest);
+ highest = MAX(G->value->total, highest);
}
}
}
@@ -225,7 +225,7 @@ void EditorProfiler::_update_plot() {
int *column = columnv.ptrw();
- Map<StringName, int> prev_plots;
+ HashMap<StringName, int> prev_plots;
for (int i = 0; i < total_metrics * w / frame_metrics.size() - 1; i++) {
for (int j = 0; j < h * 4; j++) {
@@ -234,32 +234,32 @@ void EditorProfiler::_update_plot() {
int current = i * frame_metrics.size() / w;
- for (Set<StringName>::Element *E = plot_sigs.front(); E; E = E->next()) {
+ for (RBSet<StringName>::Element *E = plot_sigs.front(); E; E = E->next()) {
const Metric &m = _get_frame_metric(current);
float value = 0;
- const Map<StringName, Metric::Category *>::Element *F = m.category_ptrs.find(E->get());
+ HashMap<StringName, Metric::Category *>::ConstIterator F = m.category_ptrs.find(E->get());
if (F) {
- value = F->get()->total_time;
+ value = F->value->total_time;
}
- const Map<StringName, Metric::Category::Item *>::Element *G = m.item_ptrs.find(E->get());
+ HashMap<StringName, Metric::Category::Item *>::ConstIterator G = m.item_ptrs.find(E->get());
if (G) {
if (use_self) {
- value = G->get()->self;
+ value = G->value->self;
} else {
- value = G->get()->total;
+ value = G->value->total;
}
}
int plot_pos = CLAMP(int(value * h / highest), 0, h - 1);
int prev_plot = plot_pos;
- Map<StringName, int>::Element *H = prev_plots.find(E->get());
+ HashMap<StringName, int>::Iterator H = prev_plots.find(E->get());
if (H) {
- prev_plot = H->get();
- H->get() = plot_pos;
+ prev_plot = H->value;
+ H->value = plot_pos;
} else {
prev_plots[E->get()] = plot_pos;
}
@@ -515,7 +515,7 @@ Vector<Vector<String>> EditorProfiler::get_data_as_csv() const {
}
// Different metrics may contain different number of categories.
- Set<StringName> possible_signatures;
+ RBSet<StringName> possible_signatures;
for (int i = 0; i < frame_metrics.size(); i++) {
const Metric &m = frame_metrics[i];
if (!m.valid) {
@@ -530,11 +530,11 @@ Vector<Vector<String>> EditorProfiler::get_data_as_csv() const {
}
// Generate CSV header and cache indices.
- Map<StringName, int> sig_map;
+ HashMap<StringName, int> sig_map;
Vector<String> signatures;
signatures.resize(possible_signatures.size());
int sig_index = 0;
- for (const Set<StringName>::Element *E = possible_signatures.front(); E; E = E->next()) {
+ for (const RBSet<StringName>::Element *E = possible_signatures.front(); E; E = E->next()) {
signatures.write[sig_index] = E->get();
sig_map[E->get()] = sig_index;
sig_index++;
@@ -662,9 +662,6 @@ EditorProfiler::EditorProfiler() {
int metric_size = CLAMP(int(EDITOR_GET("debugger/profiler_frame_history_size")), 60, 1024);
frame_metrics.resize(metric_size);
- total_metrics = 0;
- last_metric = -1;
- hover_metric = -1;
EDITOR_DEF("debugger/profiler_frame_max_functions", 64);
@@ -682,7 +679,4 @@ EditorProfiler::EditorProfiler() {
plot_sigs.insert("physics_frame_time");
plot_sigs.insert("category_frame_time");
-
- seeking = false;
- graph_height = 1;
}