hitTestObject performance


I’m having some big performance issues on the iOS platform around hitTestObject usage.

I have something like this:

for(orb in orbs) {
    collided = orb.hitTestObject(ship);

if the array contains more than about 15 objects, then performance degrades greatly, if I comment the call to hitTestObject, the framerate immediately shoots up. I’m using OpenFL 2.2.8.

I believe in legacy, it goes through the renderer to determine a hit test. Is there a difference if you use hitTestPoint?

Ok, so inside the parent Sprite I had another Sprite and a Bitmap. The Child Sprite had another Bitmap inside of it. The reason I did this was to apply a colour transformation to the child Sprite without affecting the Bitmap on the parent.
If I strip all of this, and only add the Bitmap directly to the parent Sprite, then I can have dozens of objects without performance degradation.

I’m now going to try adding a transparent Bitmap inside the parent sprite and use that for the collisions, which should fix the performance issue.

Do you think trying the hitTestPoint is still worth it?

EDIT: Sorry, I’m an idiot, it’s still slow, I was bypassing the call to hitTestObject.
I’ve tried increasing the number of shots in the game, which is a different object, and I can fill the screen with it and still get good performance, so there’s definitely something dodgy with this orb object…
To make it even more puzzling, the shots move around, and the orbs don’t it’s literally a Sprite with a bitmap inside of it just sitting there.