I'm writing a graphics and physics library (like half a million other programmers), in C# (like maybe five other programmers), mostly out of books at this point. However, I'm trying some speed optimizations, for which I'm doing some speed profiling.
I have a .World.CollisionLoop() function; it calls fine. However, it also calls a World.(CollisionLoop)b_0() and World.(CollisionLoop)b_1(), the last of which is taking up 50% of .World.CollisionLoop().
I'm thinking it might be the line 开发者_如何学Pythonof code where I call bodies.Sort() and sort by position.X - bounds.X (in psuedocode and with "bounds" being an AABB for bounds tests only). However, I don't know.
How do I tell what it is to optimize it? Thanks. Using EQATEC profiler.
It was the comparison functions that the .Sort() function used to sort. Anyway, solved, ignore this. :)
精彩评论