thomasboyt / coquette-inspect

A Chrome DevTools extension for inspecting games made with the Coquette framework
29 stars 14 forks source link

Real bad performance on Box2D demo #14

Closed thomasboyt closed 9 years ago

thomasboyt commented 9 years ago

This is specifically related to the (non-)performance of serializing entities. This demo creates lots of tiny particles, each represented as an entity. Serializing all of them is mad expensive. It's unclear whether the cost is due to the number of entities, or if some very complex object is getting serialized.

thomasboyt commented 9 years ago

Update: yep, it's the complexity of the object, specifically the body object that Box2D has. Holy crap, that's complex. Even with only a handful, the game starts to lag.

This isn't really surprising, but disappointing. The only sane solution, and one that probably should have been done from the start, is to change the streaming of entities to be a subscription model, instead of serializing all the entities.