Best Practice for Duplicating USD Prims in Omniverse Fabric

Hello,

I’m developing a real-time simulation involving thousands of objects, where performance is critical. To address this, I’ve moved to Omniverse Fabric and successfully defined and manipulated primitives within Fabric itself.

However, I am struggling to efficiently create more complex objects by duplicating USD prims. I implemented an USDRT-based DeepCopy method that uses a USD prim as a template and replicates it, but the performance isn’t sufficient for my needs.

What is the recommended way to import USD prims into Fabric and duplicate them efficiently? Are there best practices or built-in methods for this use case?

Thank you!
**
Operating System:**
Windows
Kit Version:
108 (Kit App Template)
Kit Template:
Kit Base Editor
GPU Hardware:
50 series
GPU Driver:
Latest

usdrt::UsdPrim DeepCopy(usdrt::UsdStageRefPtr stage, std::string originPrimPath, std::string copyPrimPath)
{
    auto fabricId = stage->GetFabricId();
    omni::fabric::StageReaderWriter stageRW(fabricId);
    usdrt::Path primPath(originPrimPath.c_str());
    auto prim = stage->GetPrimAtPath(primPath);
    usdrt::Path copyPath(copyPrimPath.c_str());
    auto copyPrim = stage->DefinePrim(copyPath, prim.GetTypeName().GetString());
    stageRW.copyAttributes(primPath, copyPath);
    auto children = prim.GetAllChildren();
    for (auto child : children)
    {
        auto relativeChildPath = GetRelativePath(originPrimPath, child.GetPath().GetString());
        DeepCopy(stage, child.GetPath().GetString(), copyPrimPath+"/"+relativeChildPath);
    }
    return copyPrim;
}