How to use the Instanced Static Mesh Component with large numbers of instances?

Hey all,
I’d like to use the Instanced Mesh Component with a large number of instances. I noticed that the time-cost of running the UpdateInstanceTransform() function increases with the quantity of instances.
The culprit seems to be that one of the functions called in it has to run in O(n) instead of O(1). Specifically, the parts of the function inside the #if WITH_PHYSX tag.
This is the function definition in InstancedStaticMesh.cpp (Does someone know why it’s not defined in InstancedStaticMeshComponent.cpp?)

bool UInstancedStaticMeshComponent::UpdateInstanceTransform(int32 InstanceIndex, const FTransform& NewInstanceTransform, bool bWorldSpace, bool bMarkRenderStateDirty, bool bTeleport)
{
	if (!PerInstanceSMData.IsValidIndex(InstanceIndex))
	{
		return false;
	}

	if (PerInstanceSMData.Num() > 0 && PerInstanceRenderData.IsValid() && PerInstanceRenderData->InstanceBuffer.GetCurrentNumInstances() == 0 && !KeepInstanceBufferCPUAccess)
	{
		UE_LOG(LogStaticMesh, Warning, TEXT("Trying to change instance buffer for component %s, but we have no CPU copy. Set KeepInstanceBufferCPUAccess to true to keep access at the cost of memory."), *GetPathName());
		return false;
	}

	Modify();

	FInstancedStaticMeshInstanceData& InstanceData = PerInstanceSMData[InstanceIndex];

    // TODO: Computing LocalTransform is useless when we're updating the world location for the entire mesh.
	// Should find some way around this for performance.
    
	// Render data uses local transform of the instance
	FTransform LocalTransform = bWorldSpace ? NewInstanceTransform.GetRelativeTransform(GetComponentTransform()) : NewInstanceTransform;
	InstanceData.Transform = LocalTransform.ToMatrixWithScale();

	if (bPhysicsStateCreated)
	{
		// Physics uses world transform of the instance
		FTransform WorldTransform = bWorldSpace ? NewInstanceTransform : (LocalTransform * GetComponentTransform());
		FBodyInstance*& InstanceBodyInstance = InstanceBodies[InstanceIndex];
#if WITH_PHYSX
		if (NewInstanceTransform.GetScale3D().IsNearlyZero())
		{
			if (InstanceBodyInstance)
			{
				// delete BodyInstance
				InstanceBodyInstance->TermBody();
				delete InstanceBodyInstance;
				InstanceBodyInstance = nullptr;
			}
		}
		else
		{
			if (InstanceBodyInstance)
			{
				// Update existing BodyInstance
				InstanceBodyInstance->SetBodyTransform(WorldTransform, TeleportFlagToEnum(bTeleport));
				InstanceBodyInstance->UpdateBodyScale(WorldTransform.GetScale3D());
			}
			else
			{
				// create new BodyInstance
				InstanceBodyInstance = new FBodyInstance();
				InitInstanceBody(InstanceIndex, InstanceBodyInstance);
			}

		}
#endif //WITH_PHYSX
	}

	// Request navigation update
	PartialNavigationUpdate(InstanceIndex);

	if (PerInstanceRenderData.IsValid())
	{
		PerInstanceRenderData->UpdateInstanceData(this, InstanceIndex);
	}

	if (bMarkRenderStateDirty)
	{
		MarkRenderStateDirty();
	}

	return true;
}

Is there a way to avoid using this part of the function?