|
|
|
|
|
by avolcano
2228 days ago
|
|
Yeah, I suspect this is one of those things where when you Google it, people are mostly like "why would you ever need pooling in JS," but then it turns out pooling is used under the hood in a lot of game frameworks. I know Ecsy[1] is using it, which makes sense because that's targeted at apps building for WebVR which really cannot afford GC pauses, so I guess it must have some merit. I guess I could try monkey-patching immer to have it pull from a pool when creating new objects? Theoretically if it just used nominal typing (re: classes) to pick objects out of the pool and overwrite all the fields on it, as I assume it normally would do with a brand-new object, this could work out okay. Could just do pooling on the top-level component objects and deal with GC on any nested objects to simplify things (especially because nested objects probably wouldn't have classes associated with them). [1] https://ecsy.io/docs/#/manual/Architecture?id=components-poo... |
|