4 ms·
I 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 const
by noduerme 3y ago
I 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...