Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Here are some common alternatives I've seen and used:

1) Don't allocate or free resources during gameplay. Push it to load time instead. This works for things like assets that don't change much.

2) Use an arena that you reset regularly. This works well for scratch data in things like job systems or renderers.

3) Pick a fixed maximum number of entities to handle, based on hardware capacity, and use an object pool. This works well for things that actually do get created and destroyed during gameplay, on a user-visible timescale.

Together, these get you really far without any latency budget going toward freeing resources. And there is always something else you could put that budget toward instead, which is why any amount of GC is often seen as a waste.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: