Yeah, I was doing premature optimization sort of, but the majority of time is spent doing box2d, and I knew that, so is that still considered premature? My program sometimes has trouble holding 60fps (at seemingly random times). It never drops below 30, and at this point, it isn't really a problem, but my goal is to avoid a problem all together. If it becomes a bigger problem farther along, I am afraid it will turn into something that is really hard to fix, so I'm constantly looking for somewhat easy to implement optimization tricks with box2d now. But if there isn't a really easy solution, that's ok too, and it sounds like there aren't any. And I could of course always do the ray tracing thing and just drop my nifty Force Field thing.
But why are
_Unwind_SjLj_Register and
__shmem_grabber_fc_key so high on this list?
_Unwind_SjLj_Register is for exception handling.
http://stackoverflow.com/questions/6516 ... j-registerI couldn't figure out what
__shmem_grabber_fc_key is.
Number on very left is % of time spent.
Code:
% cumulative self self total
time seconds seconds calls Ts/call Ts/call name
10.71 0.54 0.54 float b2Min<float>(float, float)
8.73 0.98 0.44 operator-(b2Vec2 const&, b2Vec2 const&)
7.14 1.34 0.36 b2PairLessThan(b2Pair const&, b2Pair const&)
6.35 1.66 0.32 void b2DynamicTree::Query<b2BroadPhase>(b2BroadPhase*, b2AABB const&) const
6.15 1.97 0.31 float b2Max<float>(float, float)
4.56 2.20 0.23 __shmem_grabber_fc_key ////////////////////////////////
4.17 2.41 0.21 _Unwind_SjLj_Register///////////////////////////////////////////
4.17 2.62 0.21 b2Pair* std::__unguarded_partition<b2Pair*, b2Pair, bool (*)(b2Pair const&, b2Pair const&)>(b2Pair*, b2Pair*, b2Pair const&, bool (*)(b2Pair const&, b2Pair const&))
3.97 2.82 0.20 b2Min(b2Vec2 const&, b2Vec2 const&)
3.77 3.01 0.19 b2Vec2::b2Vec2(float, float)
3.37 3.18 0.17 void b2BroadPhase::UpdatePairs<b2ContactManager>(b2ContactManager*)
3.17 3.34 0.16 b2Max(b2Vec2 const&, b2Vec2 const&)
3.17 3.50 0.16 b2Mul(b2Transform const&, b2Vec2 const&)
2.78 3.64 0.14 b2TestOverlap(b2AABB const&, b2AABB const&)
2.58 3.77 0.13 b2DynamicTree::InsertLeaf(int)
1.98 3.87 0.10 b2GrowableStack<int, 256>::Push(int const&)
1.79 3.96 0.09 b2PolygonShape::ComputeAABB(b2AABB*, b2Transform const&, int) const
1.59 4.04 0.08 b2GrowableStack<int, 256>::Pop()
1.59 4.12 0.08 void std::__unguarded_linear_insert<b2Pair*, bool (*)(b2Pair const&, b2Pair const&)>(b2Pair*, bool (*)(b2Pair const&, b2Pair const&))
1.39 4.19 0.07 b2DynamicTree::Balance(int)
1.19 4.25 0.06 b2DynamicTree::RemoveLeaf(int)
1.19 4.31 0.06 b2GrowableStack<int, 256>::GetCount()
1.19 4.37 0.06 b2AABB::Combine(b2AABB const&, b2AABB const&)