Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Collection authoring slow for crate files #1345

Closed
johnhaddon opened this issue Sep 29, 2020 · 1 comment
Closed

Collection authoring slow for crate files #1345

johnhaddon opened this issue Sep 29, 2020 · 1 comment

Comments

@johnhaddon
Copy link

Description of Issue

When authoring large collections, performance is significantly poorer for .usdc files than it is for .usda.

Steps to Reproduce

Run the following script :

import time

from pxr import Usd
from pxr import UsdGeom

def runTest( fileType ) :

	title = "Testing " + fileType
	print title
	print "=" * len( title ) + "\n"

	stage = Usd.Stage.CreateNew( "/tmp/testCollections." + fileType )

	paths = []

	def makeHierarchy( prim, depth = 0 ) :

		if depth > 0 :
			paths.append( prim.GetPath() )

		if depth > 5 :
			return

		for i in range( 0, 5 ) :
			childPath = prim.GetPath().AppendChild( "p" + str( i ) )
			xform = UsdGeom.Xform.Define( stage, childPath )
			makeHierarchy( xform, depth + 1 )

	t = time.time()
	root = UsdGeom.Xform.Define( stage, "/root" )
	makeHierarchy( root )
	print "Created {} prims in {} seconds".format( len( paths ), time.time() - t )

	collection = Usd.CollectionAPI.ApplyCollection( root.GetPrim(), "allOfTheThings", Usd.Tokens.explicitOnly )

	t = time.time()
	collection.CreateIncludesRel().SetTargets( paths )
	print "Set {} targets in {} seconds".format( len( paths ), time.time() - t )

	t = time.time()
	stage.GetRootLayer().Save()
	print "Saved in {} seconds".format( time.time() - t )

runTest( "usda" )
print ""
runTest( "usdc" )

System Information (OS, Hardware)

CentOS Linux release 7.7.1908, ageing Intel workstation.

Package Versions

Tested with 20.05 and 20.08.

Build Flags

See https://github.com/GafferHQ/dependencies/blob/master/USD/config.py

@jilliene
Copy link

jilliene commented Oct 2, 2020

Filed as internal issue #USD-6385

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants