3 ms·
You are conflating object pools and ECS architecture. Yes, they work very well together, but neither is required for the other. The ECS architecture is about w
by feoren 3y ago
You are conflating object pools and ECS architecture. Yes, they work very well together, but neither is required for the other.
The ECS architecture is about which parts of your application are concerned with what, and it's an absolute godsend for building complex and flexible business logic. I would be loathe to ever use anything else now that I have tasted this golden fruit.
Object pooling is about memory management; in an OO language this is about reducing pressure on the garbage collector, limiting allocation and GC overhead, improving memory access patterns, etc. -- all the stuff he talks about in this article. I almost never use object pools unless I'm running a huge calculation or simulation server-side.
Games use both, because they're basically big simulations.
- noduerme 3y agoI write business logic and I use a fair amount of object pooling. It's not quite the same as in game dev or e.g. a socket pool or worker pool where you're constantly swapping tons of things in and out, but it can still be helpful to speed up the user experience, manage display resources and decrease database load. One example would be endless-scrolling calendar situations, or data tables with thousands of rows, or anything where I'm using broader pagination in the database calls than I want to in the display chain; maybe I can call up 300 upcoming reservations every time the calendar moves, erase the DOM and redraw 300 nodes, but I'd rather call up 3,000 all at once and use a reusable pool of 300 DOM nodes to display them. Sure, it's not glamorous...
- dgreensp 3y agoThis is interesting. Do you have any links on use of ECS for application logic?