[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [55241] trunk/blender/source/blender/ compositor/intern: Report timing compositor statistics when running in background mode.
Sergey Sharybin
sergey.vfx at gmail.com
Wed Mar 13 15:50:37 CET 2013
Revision: 55241
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=55241
Author: nazgul
Date: 2013-03-13 14:50:36 +0000 (Wed, 13 Mar 2013)
Log Message:
-----------
Report timing compositor statistics when running in background mode.
This would help figuring out time spent on compositing, helpful for
render farms.
Modified Paths:
--------------
trunk/blender/source/blender/compositor/intern/COM_ExecutionGroup.cpp
trunk/blender/source/blender/compositor/intern/COM_ExecutionGroup.h
Modified: trunk/blender/source/blender/compositor/intern/COM_ExecutionGroup.cpp
===================================================================
--- trunk/blender/source/blender/compositor/intern/COM_ExecutionGroup.cpp 2013-03-13 14:50:33 UTC (rev 55240)
+++ trunk/blender/source/blender/compositor/intern/COM_ExecutionGroup.cpp 2013-03-13 14:50:36 UTC (rev 55241)
@@ -40,6 +40,7 @@
#include "MEM_guardedalloc.h"
#include "BLI_math.h"
+#include "BLI_string.h"
#include "BKE_global.h"
#include "PIL_time.h"
#include "WM_api.h"
@@ -62,6 +63,7 @@
this->m_singleThreaded = false;
this->m_chunksFinished = 0;
BLI_rcti_init(&this->m_viewerBorder, 0, 0, 0, 0);
+ this->m_executionStartTime = 0;
}
CompositorPriority ExecutionGroup::getRenderPriotrity()
@@ -230,6 +232,8 @@
if (this->m_numberOfChunks == 0) {return; } /// @note: early break out
unsigned int chunkNumber;
+ this->m_executionStartTime = PIL_check_seconds_timer();
+
this->m_chunksFinished = 0;
this->m_bTree = bTree;
unsigned int index;
@@ -415,7 +419,11 @@
{
uintptr_t mem_in_use, mmap_in_use, peak_memory;
float megs_used_memory, mmap_used_memory, megs_peak_memory;
+ double execution_time;
+ char timestr[64];
+ execution_time = PIL_check_seconds_timer() - this->m_executionStartTime;
+
mem_in_use = MEM_get_memory_in_use();
mmap_in_use = MEM_get_mapped_memory_in_use();
peak_memory = MEM_get_peak_memory();
@@ -427,6 +435,8 @@
fprintf(stdout, "Mem:%.2fM (%.2fM, Peak %.2fM) ",
megs_used_memory, mmap_used_memory, megs_peak_memory);
+ BLI_timestr(execution_time, timestr);
+ printf("| Elapsed %s ", timestr);
printf("| Tree %s, Tile %d-%d ", this->m_bTree->id.name + 2,
this->m_chunksFinished, this->m_numberOfChunks);
Modified: trunk/blender/source/blender/compositor/intern/COM_ExecutionGroup.h
===================================================================
--- trunk/blender/source/blender/compositor/intern/COM_ExecutionGroup.h 2013-03-13 14:50:33 UTC (rev 55240)
+++ trunk/blender/source/blender/compositor/intern/COM_ExecutionGroup.h 2013-03-13 14:50:36 UTC (rev 55241)
@@ -167,7 +167,12 @@
* @note measured in pixel space
*/
rcti m_viewerBorder;
-
+
+ /**
+ * @brief start time of execution
+ */
+ double m_executionStartTime;
+
// methods
/**
* @brief check whether parameter operation can be added to the execution group
More information about the Bf-blender-cvs
mailing list