BpSAP.(post)UpdateWork spikes for a few frames?

We have spikes in SAP broadphase for a few frames (presumably it happens when we spawn enemies). Our enemies consist of a bunch of colliders and we don’t use aggregates.
It spikes for ~5 frames in BpSAP.updateWork and BpSAP.postUpdateWork. It increases physics update by around 10ms on PS4 and that’s a serious offender. How do I trace this?
I tried MBP and I have not seen this problem there. We’d prefer to stick to SAP if this can be easily fixed.

Could you please provide a PVD capture of the spike for us to analyse? It will help us understand what’s happening in the scene. Also, could you confirm which version of PhysX you are using?

The MBP algorithm is generally faster for scenes containing large numbers of shapes (10s of 1000s) and handles insertions and removals better. BpSAP is more efficient in scenes with fewer shapes, or complex scenes where there is a large amount of frame-frame coherence. Each algorithm has its advantages/disadvantages.

There are a number of things you can do to help performance. This simplest, which you mentioned, would be careful utilisation of aggregates. Even just using them for your characters and nothing else could have a big impact. For example, if your character is constructed from 10 colliders, using aggregates could reduce the spike by 10x or more in this case.

Hi kstorey,

Thanks for quick reply.
I managed to localize this issue and it indeed happens, when we spawn enemies in our game.
I captured it in PhysX Visual Debugger (from PC build of the game) and in PS4 CPU profiler (if that can help you).
How can I share those captures with you privately?

I’ll send you a DM with a temporary FTP account to upload to