Loading USDZ file take almost 30s

I'm having issue with loading 1.2GB USDZ file with visionOS Here's the details

  • the file is download via backend api
  • file is download to document directory
FileManager.default.url(for: .documentDirectory, in: .userDomainMask, appropriateFor: nil, create: true)
  • when loading the asset, it took almost 30s to load the asset
Loaded usd((extension in RealityFoundation):RealityKit.Entity.LoadStatistics.USDLoader.rio) in 29.24642503261566 seconds

loading asset code

let model = try await Entity(contentsOf: assetUrl)
  • USDZ file is exported from RealityComposerPro

Did I make any mistake on the flow or is there any other approach to decrease the loading time?

Hello,

if you are able to share the USDZ file, you can upload it to a ticket on http://feedbackassistant.apple.com and if you share the ticket ID we can investigate to see if there are any performance bottlenecks. You can also take a Time Profiler trace, in Instruments, of the loading.

But, in general, you need to optimize your assets to be rendered in realtime, in order to have good loading times and a good framerate when rendering the scene. If your assets have been created for offline rendering, you need to optimize them before rendering them in realtime; this article lists several guidelines: https://developer.apple.com/documentation/realitykit/construct-an-immersive-environment-for-visionos. And this video might also be useful: https://developer.apple.com/videos/play/wwdc2024/10186/

Loading USDZ file take almost 30s
 
 
Q