Navigation Menu

Skip to content

Commit

Permalink
Speed up saving of profiling data by 27x
Browse files Browse the repository at this point in the history
On Windows Release x64 bit build this changes:

ProfilerGraph::put
1.68% -> 0.061%

ProfilerGraph::draw
12% -> 17.%

So yes, there is a tradeoff between saving profiling data
(executed always) and drawing the profiler graph (executed very rarely).
But usually you don't have the profiler graph open.
  • Loading branch information
gregorycu authored and est31 committed Nov 2, 2015
1 parent eabfe09 commit 5c3546e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/game.cpp
Expand Up @@ -489,7 +489,7 @@ class ProfilerGraph
color(color)
{}
};
std::vector<Piece> m_log;
std::deque<Piece> m_log;
public:
u32 m_log_max_size;

Expand All @@ -512,7 +512,7 @@ class ProfilerGraph
{
std::map<std::string, Meta> m_meta;

for (std::vector<Piece>::const_iterator k = m_log.begin();
for (std::deque<Piece>::const_iterator k = m_log.begin();
k != m_log.end(); ++k) {
const Piece &piece = *k;

Expand Down Expand Up @@ -600,7 +600,7 @@ class ProfilerGraph
float lastscaledvalue = 0.0;
bool lastscaledvalue_exists = false;

for (std::vector<Piece>::const_iterator j = m_log.begin();
for (std::deque<Piece>::const_iterator j = m_log.begin();
j != m_log.end(); ++j) {
const Piece &piece = *j;
float value = 0;
Expand Down

0 comments on commit 5c3546e

Please sign in to comment.