DEV Community

[Comment from a deleted post]
Collapse
 
mvoloskov profile image
Miloslav 🏳️‍🌈 🦋 Voloskov

Nice question.

You pretty much can't achieve that kind of performance in immutable data structures without it being persistent. Something like ImmutableJS or MoriJS is absolutely necessary there.

If you don't need the time traveling here, I'd go with something mutable like MobX because it will obviously outperform any persistent stuff you can do in the browser.

Going even bigger, I suggest you choose a really fast backend and calculate everything there so all frontend has to do is just react to WebSocket message and just apply that data as is, without any changes. This is by far the fastest approach I'd personally use solving this task.