Skip to content

Commit 5c3546e

Browse files
gregorycuest31
authored andcommittedNov 2, 2015
Speed up saving of profiling data by 27x
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.
1 parent eabfe09 commit 5c3546e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed
 

‎src/game.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,7 @@ class ProfilerGraph
489489
color(color)
490490
{}
491491
};
492-
std::vector<Piece> m_log;
492+
std::deque<Piece> m_log;
493493
public:
494494
u32 m_log_max_size;
495495

@@ -512,7 +512,7 @@ class ProfilerGraph
512512
{
513513
std::map<std::string, Meta> m_meta;
514514

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

@@ -600,7 +600,7 @@ class ProfilerGraph
600600
float lastscaledvalue = 0.0;
601601
bool lastscaledvalue_exists = false;
602602

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

0 commit comments

Comments
 (0)
Please sign in to comment.