Hello,
We use the DataValidationCommandlet for pre-submit testing. This commandlet has historically taken a long time to execute but its performance has worsened over time. Upon profiling the execution of the commandlet in a “hot” environment, meaning that all asset data is cached and ready, it appears that assets are being loaded unconditionally meaning that a huge amount of time is wasted loading assets that don’t have any matching validators that need to process them.
Total Number Of Assets: ~300,000
Total Number Of Validators: ~12
Total Time Spent in DataValidationCommandlet: ~10 minutes
Total Time Spent in ValidateAsset: 8.2 seconds
Total Time Spent in FlushAsyncLoading: 8.6 minutes
Hardware: 9950X, 128 GB DDR5, Fast NVMe drives.
After looking at the code in UEditorValidatorSubsystem::ValidateAssetsInternal, it appears that it unconditionally loads all assets that it finds before it finds out if any validators actually need this asset to be loaded. While this is not a problem for a small number of assets, as you start to scale up and as the assets get more complex then this loading strategy really starts to cause problems.
It seems like to me that a potential more efficient option would be to first use the minimal asset data that is available in FAssetData and use that to determine if any validator needs this asset to be fully loaded. Obviously you have problems with validators that return true for all assets but those validators can simply be moved off outside of pre-submit tests and into a nightly validator that isn’t as time critical.
Can you please advise on the following.
- Am I correct about the unconditional loading of assets here or do we have something misconfigured to cause this and if so, why is it this way?
- What approach do you recommend to reduce the time spent executing the data validation commandlet but still maintain full coverage over all assets we need to validate?
- What do you think of my approach to first use the minimal FAssetData to determine if any validators actually need this asset to be loaded before loading the asset?
- I know there are options to not validate unload assets but then that means assets don’t get validated when we need them to be.
I have attached my UTRACE for reference but it’s probably not that useful.
Looking forward to your reply.
Cheers!
[Attachment Removed]