ynput / ayon-core

Apache License 2.0
33 stars 36 forks source link

Maya: Collect Render slows down publishing a lot #817

Open BigRoy opened 2 years ago

BigRoy commented 2 years ago

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:

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):

[cuID:OP-3451]

BigRoy commented 2 years ago
Note

I should add that I had done a similar optimization for the verbose logging in CollectAnatomyContextData, CollectAnatomyInstanceData and CollectInstances to not log the full json dumped data unless OPENPYPE_DEBUG == 1. That's also why collecting on my end might have been under a second after this change - if you try and reproduce the speed up you migth still see slow-downs due to those collectors also being very slow.

iLLiCiTiT commented 2 years ago

I agree that logging full instance or context data is overkill especially when it's in each plugin.

BigRoy commented 4 months ago

Heavy logging still slows down publishing a lot. We may want to reduce the print-out to host consoles, etc.