thomasboyt / coquette-inspect

A Chrome DevTools extension for inspecting games made with the Coquette framework

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Real bad performance on Box2D demo

thomasboyt opened this issue · comments

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.

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.