Alrecenk / JSTimelineSync

A quick and dirty prototype for testing generalized rollback networking.
MIT License
5 stars 1 forks source link

Percompute maps of hashes #23

Closed Alrecenk closed 2 years ago

Alrecenk commented 2 years ago

There are a few places where a map of hashes of events or objects is needed for quick look-ups, and it is built on demand. This O(n) map building is a significant CPU overhead that will get dramatically worse as the number of objects increases. These maps should be precomputed and cached, or if that's not practical their use should be avoided entirely.

Alrecenk commented 2 years ago

There was really only one big offender. Fixed in https://github.com/Alrecenk/JSTimelineSync/pull/36