I have been working on ways to load and handle USD data in Maya and I have noticed that when I load a USD file that contains some animation the first playthrough always runs slow (lower fps) and then the rest of playthroughs run faster at a more expected fps. I am guessing it is doing some initial caching. I have tried to improve this initial slowdown through my C++ work without much success.
I have noticed that this also happens in UsdView, it will also have a slow initial playthrough and the ones after that will be faster.
Is this the norm with USD? Is there any way to pre-cache this information or have a work around it so that the user doesn’t have to wait for an initial playthrough to happen before the animation plays smoothly?
When you observe this behavior in usdview, if you then quit and restart usdview, do you observe the same disparity between first and subsequent playthroughs, or is it lesser?
OK, then. I would predict that a file stored on a machine’s local SSD/HD would likely consistently have shorter first-time lags. But assuming your production data is accessed from network drives, the fact that usdc files specifically lay out timesample data to reduce the overall network traffic required to render a single frame of data (i.e. data is laid out time-coherently, for the most part), it means thatat each frame-change usdImaging is goinf out to pull more pages across the network - just the pages it needs for the next frame (more or less). Those pages are then cached on your local drive (competing with other remotely accessed data for cache space), so if your OS does not run out of cache space, the second access of each frame will be faster.
When we design performance tests for playback, we always run the test once and discard the results, then run it again, so that we start from the “locally cached” state, since variance in network access speeds can be very high, also.
Ah ok, thanks for the information! I did a quick test storing the file in my local machine and it does seem to have a faster initial animation that way. It sounds then like there is no way to avoid that initial slow-down since we do store our data in network drives.