Hi I'm trying to resolve some performance issues on the PSP with this. While looking at this I noticed it was doing loads of allocations and deletes.
Is there any way to reserve space at the start of a level and only have an allocation if I understimated.
I tried a couple of changes.
in
btCompoundCollisionAlgorithm::processCollision
I changed
manifoldArray.clear();
to
manifoldArray.resize(0);
which gave me a very small improvement
I then made manifoldArray a member variable gave me 6% increase in speed
and
changing some of the stacks in btDbvt (which is also used in btCompoundCollisionAlgorithm::processCollision) to
members gave me a further 14% increase in speed
so I managed to an overall get 20% increase in speed just by these 2 changes.
ok this is particular case, but allowing for pre allocation in some cases would also help with memory fragmentation.
I may also have missed an option somewhere so if it possible to get bullet to do this already could you please point me in the right direction.
thanks
Steve
dynamic memory allocation performance issues
-
Erwin Coumans
- Site Admin
- Posts: 4221
- Joined: Sun Jun 26, 2005 6:43 pm
- Location: California, USA
Re: dynamic memory allocation performance issues
Thanks for the feedback. Do you have a patch for that (attach as zipfile here or in the google issue tracker)?
Thanks,
Erwin
Thanks,
Erwin
-
SteveDH
- Posts: 4
- Joined: Thu Apr 29, 2010 2:12 pm
Re: dynamic memory allocation performance issues
sorry bit new to this, for a patch do I just zip up the source files or is it something more complicated 
-
pico
- Posts: 229
- Joined: Sun Sep 30, 2007 7:58 am
Re: dynamic memory allocation performance issues
Hi Steve,
in general i would suggest you implement an own allocator for Bullets allocations that should have its own heap. We use that in our games and it speeded up everything quite a bit. Bullet is already prepared to implement an own allocator.
in general i would suggest you implement an own allocator for Bullets allocations that should have its own heap. We use that in our games and it speeded up everything quite a bit. Bullet is already prepared to implement an own allocator.