Page MenuHome

Allow reporting of time in seconds.
Needs RevisionPublic

Authored by LazyDodo (LazyDodo) on Sun, Sep 29, 12:58 AM.

Details

Summary

I've been spending a lot of time benchmarking recently and found my self
converting from h:m:s to just seconds over and over again.

This patch allows one to set an environment variable REPORT_TIME_IN_SECONDS

to just have blender/cycles report in seconds right away.

before:

Fra:1 Mem:261.28M (0.00M, Peak 389.25M) | Time:00:04.89 | Mem:137.96M, Peak:137.96M | Scene, RenderLayer | Updating Device | Writing constant memory
Fra:1 Mem:261.28M (0.00M, Peak 389.25M) | Time:00:04.90 | Mem:137.96M, Peak:137.96M | Scene, RenderLayer | Rendered 0/510 Tiles
Fra:1 Mem:261.53M (0.00M, Peak 389.25M) | Time:00:14.74 | Remaining:11:08.96 | Mem:138.20M, Peak:138.23M | Scene, RenderLayer | Rendered 1/510 Tiles
Fra:1 Mem:261.53M (0.00M, Peak 389.25M) | Time:00:14.75 | Remaining:11:09.81 | Mem:138.20M, Peak:138.23M | Scene, RenderLayer | Rendered 2/510 Tiles

After:

Fra:1 Mem:261.28M (0.00M, Peak 388.26M) | Time:4.74s | Mem:137.96M, Peak:137.96M | Scene, RenderLayer | Updating Device | Writing constant memory
Fra:1 Mem:261.28M (0.00M, Peak 388.26M) | Time:4.74s | Mem:137.96M, Peak:137.96M | Scene, RenderLayer | Rendered 0/510 Tiles
Fra:1 Mem:261.53M (0.00M, Peak 388.26M) | Time:14.73s | Remaining:679.44s | Mem:138.20M, Peak:138.23M | Scene, RenderLayer | Rendered 1/510 Tiles
Fra:1 Mem:261.50M (0.00M, Peak 388.26M) | Time:14.74s | Remaining:680.82s | Mem:138.17M, Peak:138.23M | Scene, RenderLayer | Rendered 2/510 Tiles
Fra:1 Mem:261.53M (0.00M, Peak 388.26M) | Time:14.79s | Remaining:680.87s | Mem:138.20M, Peak:138.23M | Scene, RenderLayer | Rendered 3/510 Tiles

Diff Detail

Repository
rB Blender
Branch
tmp_timecode (branched from master)
Build Status
Buildable 5155
Build 5155: arc lint + arc unit

Event Timeline

It's a little bit of a hack, it bugged me enough to fix it, but not to make it available in the UI for end users, it's one of those "it scratched my itch" patches, if we don't want this in mainline I understand.

Dalai Felinto (dfelinto) requested changes to this revision.Tue, Oct 15, 5:05 AM

Sergey can you take over this review? It is super simple.

I personally would rather we have this as a cli option (--debug-time-format) instead of obscure environment variables that sitll need to be documented somewhere.

intern/cycles/util/util_time.cpp
76

Comment needs update.

source/blender/blenlib/intern/timecode.c
37

I know you are just following existing code, but I would rather we don't add these kind of comments. They get outdated really quickly.
Also I know it is a mess right now, but I would rather you added it grouped with the other BLI_* (e.g., before BKE_utildefines.h)

BLI_strict_flags.h is an exception I guess.

This revision now requires changes to proceed.Tue, Oct 15, 5:05 AM

We shouldn't be using environment variables for this.
It is also somewhat worrying to modify BLI_timecode_string_from_time_simple(). You are risking producing file metadata in some obscure format.

Also, having this prints as a hint of benchmark is not reliable. Use --debug-cycles which will give you time in seconds for both total time and path tracing time.
To me it seems exposing this summary of times of various steps is the actual goal which we are trying to reach here.

blender --render-time-summary
Fra:1 Mem:261.53M (0.00M, Peak 388.26M) | Time:14.79s | Remaining:680.87s | Mem:138.20M, Peak:138.23M | Scene, RenderLayer | Rendered 3/510 Tiles
....
Finished
...
Total render time: 100,500.14 sec
Preparation time: 100 sec
  Geometry synchronization time: 200 sec
  BVH build time; 1,024 sec
  Image load time: 512 sec
Path tracing time: 100,000.32 sec

This is something what will give you easy to read numbers and something what we will enable immediately on the farm :)