schteppe / p2.js

JavaScript 2D physics library
Other
2.64k stars 330 forks source link

Wiki page idea: high-level optimization advice #251

Open danneu opened 8 years ago

danneu commented 8 years ago

It'd be a great asset to the community if there was a high-level bulleted-list / check-list of sorts that enumerates the various optimizations to consider, ideally with some sample implementation, from simple to advanced.

I reckon a lot of people are like me, kind faking it til they make it with their physics simulation, and could use some preliminary guidance and examples to get into the headspace of optimizing a physics simulation and where to find the low-hanging fruit.

For example, in which cases would one use shape.sensor = true vs shape.collisionResponse = false, and what's the actual impact of them?

I'm definitely not in a position to write such a list, but here are some examples that might not be accurate -- just for demonstration:

schteppe commented 8 years ago

Good idea! I think the list could become pretty long and contain many game-genre specific things...

Some things I'd like to add to the list:

What do you think?

Any ideas for the format of the "How to profile" part?