generated from ynput/ayon-addon-template
-
Notifications
You must be signed in to change notification settings - Fork 18
Open
Labels
type: enhancementImprovement of existing functionality or minor additionImprovement of existing functionality or minor addition
Description
Performance in publishing
I am creating this issue to track list of plugins to investigate for performance issues. These plugins will need better profiling. Plugins marked with * are not maya specific but are triggered during the publish - their profiling/refactoring should be done on issue created in their respective repositories.
Initial test case was programmatically create 1000 instances and then observer/profile the process. You can use code similar to this and run it in the Script Editor:
from ayon_core.pipeline import (
registered_host,
get_current_project_name,
get_current_folder_path,
get_current_task_name,
)
from ayon_core.pipeline.create import CreateContext, CreatorError, Creator
from ayon_core.pipeline.context_tools import (
get_current_project_entity,
get_current_folder_entity,
get_current_task_entity,
)
from maya import cmds # noqa
product_count = 10
creator_id = "io.openpype.creators.maya.model"
create_context = CreateContext(
host=registered_host(), headless=True, discover_publish_plugins=False
)
creator: Creator = create_context.creators.get(creator_id)
if not creator:
raise CreatorError(f"Creator {creator_id} not found.")
for product_idx in range(product_count):
variant = f"ProdVar{product_idx + 1}"
product_name = creator.get_product_name(
get_current_project_name(),
get_current_folder_entity(),
get_current_task_entity(),
variant,
)
print(f"Creating product {product_name} of {product_count}...")
cmds.select(clear=True)
cube = cmds.polyCube(sx=1, sy=1, sz=1)[0]
cmds.sets(cube, name=product_name)
instance_data = {
"folderPath": get_current_folder_path(),
"task": get_current_task_name(),
"variant": variant,
"instance_node": cmds.sets(cube, name=product_name)
}
instance = creator.create(
product_name=product_name,
instance_data=instance_data,
pre_create_data={"use_selection": True},
)Initial plugins are:
Assembly model transforms
Connect dependency inputlinks AYON*
Explicit clean-up* (massive slowdown)
Metadata
Metadata
Assignees
Labels
type: enhancementImprovement of existing functionality or minor additionImprovement of existing functionality or minor addition