ayon-core icon indicating copy to clipboard operation
ayon-core copied to clipboard

Maya: Collect Render slows down publishing a lot

Open BigRoy opened this issue 2 years ago • 3 comments

Describe the bug

Collect Render is really slow for large scenes with many layers. The only reason why it's slow is due to these logging lines:

  • https://github.com/pypeclub/OpenPype/blob/develop/openpype/hosts/maya/plugins/publish/collect_render.py#L217
  • https://github.com/pypeclub/OpenPype/blob/develop/openpype/hosts/maya/plugins/publish/collect_render.py#L298
  • https://github.com/pypeclub/OpenPype/blob/develop/openpype/hosts/maya/plugins/publish/collect_render.py#L413

That changes a scene that takes 15+ seconds to collect back down to <1 second to collect when they are removed.

The issue also is that with that much logged data somehow the Pyblish Pype UI gets relatively slow. The UI remains repsonsive just fine when not processing (except when looking into the logs of that plug-in) but it gets really really sluggish during processing when needing to log more. For example, with the logs still enabled validation also becomes very slow for my test scene - but with those logs just removed in collect_render then validation also becomes close to instant.

It's a huge speed difference.

I've quickly tested moving these into an if branch so it only runs if os.environ.get("OPENPYPE_DEBUG") == "1" and that also worked.

To Reproduce Steps to reproduce the behavior:

  1. Create 10 Render Setup layers (so there's quite a few layers to process)
  2. Set render frame range to have 200+ frames, e.g. 1001-1300 (just so expected files list is large to log)
  3. Try to publish/submit scene. It'll be very slow.

Expected behavior

Should be instant.

Desktop (please complete the following information):

  • OS: Windows
  • Host: Maya 2022

[cuID:OP-3451]

BigRoy avatar Jun 23 '22 07:06 BigRoy