diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-03-13 18:50:36 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-03-13 18:50:36 +0400 |
commit | f530adf73d8e1f4914391cb3c3e96b2196612e92 (patch) | |
tree | 39fdc7301fab513f63628c91cd8dd7a4188bb283 /source/blender/compositor/intern | |
parent | 53735787ffd5902e31861132e5cc11147cfbf5b8 (diff) |
Report timing compositor statistics when running in background mode.
This would help figuring out time spent on compositing, helpful for
render farms.
Diffstat (limited to 'source/blender/compositor/intern')
-rw-r--r-- | source/blender/compositor/intern/COM_ExecutionGroup.cpp | 10 | ||||
-rw-r--r-- | source/blender/compositor/intern/COM_ExecutionGroup.h | 7 |
2 files changed, 16 insertions, 1 deletions
diff --git a/source/blender/compositor/intern/COM_ExecutionGroup.cpp b/source/blender/compositor/intern/COM_ExecutionGroup.cpp index 7d34db1d933..14fd7e0b6cf 100644 --- a/source/blender/compositor/intern/COM_ExecutionGroup.cpp +++ b/source/blender/compositor/intern/COM_ExecutionGroup.cpp @@ -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 @@ ExecutionGroup::ExecutionGroup() 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 @@ void ExecutionGroup::execute(ExecutionSystem *graph) 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,6 +419,10 @@ void ExecutionGroup::printBackgroundStats(void) { 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(); @@ -427,6 +435,8 @@ void ExecutionGroup::printBackgroundStats(void) 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); diff --git a/source/blender/compositor/intern/COM_ExecutionGroup.h b/source/blender/compositor/intern/COM_ExecutionGroup.h index b5952611c1b..b5f02e05be1 100644 --- a/source/blender/compositor/intern/COM_ExecutionGroup.h +++ b/source/blender/compositor/intern/COM_ExecutionGroup.h @@ -167,7 +167,12 @@ private: * @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 |