Blender2.8: Limit log size - add a timer to Progress::set_update_callback (cycles/util/util_progress.h)

Hi,

I tried to disable a callback in Progress (cycles/util/util_progress.h):

void set_update_callback(function<void(void)> function)
{
#ifdef PROGRESS_ENABLE
update_cb = function;
#endif
}

I got very nice speed up by preparation of Spring scene (5.5min → 3.5min).

The second option is to add timer to the method set_update_callback:

void set_update_callback(function<void(void)> function)
{
if(time_now() - last_time_in_sec > 1)
{
update_cb = function;
last_time_in_sec = time_now();
}
}

This timer can save the logging to the file and the transferring the logs to flamenco server.

Could you add it to branch?

Thanks.
Milan

It indeed seems worth making this faster, though we can’t just leave out a random subset of the information. For two reasons:

  • For analysis and debugging it helps to be able to see the full logs.
  • If Cycles is stuck or spending a lot of time on something, we want to be able to see what that is.

Do you have any idea why this is so slow, did you find this out by profiling or something? I wonder if it’s the overhead in Cycles writing the data, in the print function, or in the writing to disk, or sending the logs to the server.