Performance drop after disposing mesh loaded from the assetsManager

I know I saw the answer just recently in this forum and I kind of remember it was from @labris.
Silly me just can’t find it.
Case is simple. I’m loading a mesh through the assetsManager. I rename it during the onSuccess phase.
Next, before replacing this mesh with a new task that will have the same name, I first dispose of this mesh. Everything is good and I have only one of this named mesh in the hierarchy (and no empty or no name) so I believe it is disposed… but… I experience significant performance drops after going through this process a few times. I also notice that the ‘disposed’ mesh when reloaded, loads significantly faster then on the first load. Only explanation is that it must be still cached.
I’m sure I saw something around the assetManager keeping stuff in memory… just can’t find it.
May be you @labris or someone else could kindly point me towards this.
Thanks in advance and have a great day :sunglasses:

Maybe you mean this topic?

Dunno if this helps you, but what I use is this:

Where I am unsure too, if I should useClonedMeshMap, because for now I do only instantiate with AssetContainer?


Thank you. :hugs: Yes, that was the topic but I do know realize it was about containers. Something I thought of using but is not the case now (and might be irrelevant for my use case).
I planned on using the optimizer but my scene is not yet ready for that. It could also be because the test mesh I’m using is in babylon format. I will have to dig in a little but thanks for pointing me towards this post. It is indeed the one I was looking for. Meanwhile, have a great day :sunglasses:

I will likely have to create a PG for this but I couldn’t help but notice the weird difference between absoluteFPS and FPS as soon as I load an asset (async) with the assetsManager. Before loading my mesh, my FPS are quite close to the absoluteFPS (the tiny difference is normal). But as soon as I send a loadingMesh task to the assetsManager, my absoluteFPS remains stable (drops a tiny mini from the additional load of the mesh) but my FPS go just right down to the ground, like divided by 10.
How am I supposed to understand that?

Edit: I just made an alternate version where I’m importing my mesh async (without the assetManager),
performed all of the same operations on mesh load (basically normalizetounitcube, zero it, computeWorldMatrix and scaleInplace) and … the version I do with the loadAsync keeps stable FPS and normal relation between absolute* and FPS… whilst the version made through the task for the assetManager divides my FPS by 10. Either I messed up something with my AssetsManager or? Time for a PG now, I believe…

1 Like

Sure, PG always helps :slight_smile: