From 3b51b1c8cd45b450d3fc05bb342b6421fa2e3612 Mon Sep 17 00:00:00 2001 From: Alex Zolotarev Date: Thu, 1 Sep 2011 21:42:28 +0300 Subject: [PATCH] Removed unused base/profiler. Should it be in base? --- base/base.pro | 6 ++-- base/profiler.cpp | 19 ---------- base/profiler.hpp | 78 ----------------------------------------- map/drawer_yg.cpp | 1 - map/framework.hpp | 1 - yg/geometry_batcher.cpp | 1 - yg/skin.cpp | 1 - 7 files changed, 2 insertions(+), 105 deletions(-) delete mode 100644 base/profiler.cpp delete mode 100644 base/profiler.hpp diff --git a/base/base.pro b/base/base.pro index ce2cfd284f..f7e57eb011 100644 --- a/base/base.pro +++ b/base/base.pro @@ -14,7 +14,6 @@ SOURCES += \ logging.cpp \ thread.cpp \ string_utils.cpp \ - profiler.cpp \ commands_queue.cpp \ shared_buffer_manager.cpp \ memory_mapped_file.cpp \ @@ -25,7 +24,7 @@ SOURCES += \ timer.cpp \ internal/message.cpp \ exception.cpp \ - threaded_container.cpp + threaded_container.cpp \ HEADERS += \ SRC_FIRST.hpp \ @@ -56,7 +55,6 @@ HEADERS += \ stl_add.hpp \ timer.hpp \ cache.hpp \ - profiler.hpp \ matrix.hpp \ set_operations.hpp \ condition.hpp \ @@ -69,4 +67,4 @@ HEADERS += \ runner.hpp \ mru_cache.hpp \ threaded_container.hpp \ - threaded_list.hpp + threaded_list.hpp \ diff --git a/base/profiler.cpp b/base/profiler.cpp deleted file mode 100644 index c1ebebeffb..0000000000 --- a/base/profiler.cpp +++ /dev/null @@ -1,19 +0,0 @@ -#include "profiler.hpp" - -#include "timer.hpp" - -namespace prof -{ - my::Timer timer; - - double * metrics() - { - static double data[2 * (metrics_array_size - 1)]; - return data; - } - - double timer_elapsed() - { - return timer.ElapsedSeconds(); - } -} diff --git a/base/profiler.hpp b/base/profiler.hpp deleted file mode 100644 index 68e16023e5..0000000000 --- a/base/profiler.hpp +++ /dev/null @@ -1,78 +0,0 @@ -#pragma once - -//#define PROFILER_COMMON -//#define PROFILER_DRAWING -//#define PROFILER_YG - -#define LPROF LINFO - -namespace prof -{ - enum metric_name - { - metrics_array_start = 0, - /// here custom metrics begin. - - for_each_feature, - feature_count, - do_draw, - - yg_upload_data, - yg_draw_path, - yg_draw_path_count, - yg_draw_path_body, - yg_draw_path_join, - yg_flush, - - /// here custom metrics ends. - metrics_array_size - }; - - double * metrics(); - - double timer_elapsed(); - - template - void counter() - { - metrics()[(name - 1) * 2 + 1] += 1; - } - - template - inline void start() - { - metrics()[(name - 1) * 2] = timer_elapsed(); - }; - - template - inline void end() - { - metrics()[(name - 1) * 2] = timer_elapsed() - metrics()[(name - 1) * 2]; - metrics()[(name - 1) * 2 + 1] += metrics()[(name - 1) * 2]; - } - - template - inline void reset() - { - metrics()[(name - 1) * 2 + 1] = 0; - } - - inline void reset() - { - for (unsigned i = 0; i < metrics_array_size - 1; ++i) - metrics()[i * 2 + 1] = 0; - } - - template - double metric() - { - return metrics()[(name - 1) * 2 + 1]; - } - - template - struct block - { - block() {start();} - ~block() {end();} - }; -} diff --git a/map/drawer_yg.cpp b/map/drawer_yg.cpp index 7325222f17..d2ab6d85d8 100644 --- a/map/drawer_yg.cpp +++ b/map/drawer_yg.cpp @@ -14,7 +14,6 @@ #include "../geometry/screenbase.hpp" -#include "../base/profiler.hpp" #include "../base/logging.hpp" #include "../base/buffer_vector.hpp" diff --git a/map/framework.hpp b/map/framework.hpp index 2ec5cc118d..2ba6c969dc 100644 --- a/map/framework.hpp +++ b/map/framework.hpp @@ -32,7 +32,6 @@ #include "../geometry/screenbase.hpp" #include "../base/logging.hpp" -#include "../base/profiler.hpp" #include "../base/mutex.hpp" #include "../base/timer.hpp" diff --git a/yg/geometry_batcher.cpp b/yg/geometry_batcher.cpp index e0ce31ac39..8a2fe9e16c 100644 --- a/yg/geometry_batcher.cpp +++ b/yg/geometry_batcher.cpp @@ -11,7 +11,6 @@ #include "../geometry/rect2d.hpp" #include "../base/assert.hpp" -#include "../base/profiler.hpp" #include "../base/math.hpp" #include "../base/mutex.hpp" #include "../base/logging.hpp" diff --git a/yg/skin.cpp b/yg/skin.cpp index d93092a2ee..519ef913ee 100644 --- a/yg/skin.cpp +++ b/yg/skin.cpp @@ -6,7 +6,6 @@ #include "../platform/platform.hpp" #include "../base/logging.hpp" -#include "../base/profiler.hpp" #include "../std/iterator.hpp" #include "../std/bind.hpp"