maya-usd icon indicating copy to clipboard operation
maya-usd copied to clipboard

[EMSUSD-2232] Performance while USD Layer Editor is open

Open neilrubie opened this issue 10 months ago • 2 comments

I am noticing that having the USD Layer Editor open is seriously affecting performance of the scene when making object selections. I wasn't really an issue until we were dealing with scenes with large amounts of nodes.

This behaviour can be seen in the following test setup:

# Create a large number of cubes
nodes = []
for x in range(3000):
    nodes.extend(cmds.polyCube())

# Now test the performance of selecting them:
start = cmds.timerX()
cmds.select(nodes)
totalTime = cmds.timerX(startTime=start)
print("Total time: ", totalTime)

# Here are a few of my sample outputs. Relatively quick.
# Total time:  0.13999999999987267
# Total time:  0.10999999999967258
# Total time:  0.09999999999990905

Now try creating an empty stage in the scene by going: Image

And open up the USD Layer Editor: Image

# Now test the performance of making the same selection while the layer editor is open:
start = cmds.timerX()
cmds.select(nodes)
totalTime = cmds.timerX(startTime=start)
print("Total time: ", totalTime)

# Here are a few of my sample outputs. Abysmally slow.
# Total time:  7.440000000000055
# Total time:  7.150000000000091
# Total time:  7.319999999999709

When I turn on echo all commands I can see there there are redundant ls commands being performed for every item that is selected..

ls -type mayaUsdProxyShapeBase -long;
// Result: |stage1|stageShape1
ls -type mayaUsdProxyShapeBase -long;
// Result: |stage1|stageShape1
ls -type mayaUsdProxyShapeBase -long;
// Result: |stage1|stageShape1
ls -type mayaUsdProxyShapeBase -long;
// Result: |stage1|stageShape1
ls -type mayaUsdProxyShapeBase -long;
// Result: |stage1|stageShape1
ls -type mayaUsdProxyShapeBase -long;
// Result: |stage1|stageShape1
.....

Any idea what is going on here?

Maya 2024.2, Maya 2025.1 MayaUSD 0.28 Rocky Linux 9.4

neilrubie avatar Mar 10 '25 21:03 neilrubie

Thanks for reporting. We will investigate.

wallworm avatar Mar 12 '25 14:03 wallworm

I can reproduce this on our side too, investigating a bit deeper to try and narrow down what could be the culprit on this. Logged it internally as EMSUSD-2232.

santosg87 avatar Mar 13 '25 14:03 santosg87