Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Determine and create a good object re-use scheme #12

Open
mdkess opened this issue Apr 12, 2012 · 1 comment
Open

Determine and create a good object re-use scheme #12

mdkess opened this issue Apr 12, 2012 · 1 comment
Milestone

Comments

@mdkess
Copy link
Owner

mdkess commented Apr 12, 2012

Allowing the garbage collector to run/collect memory causes a big performance hit. We should ensure that after a level is loaded, memory pools are used.

I'm leaning toward having a per type pool of object. It'll be a bunch of boilerplate code on each type, but it should be quick.

mdkess added a commit that referenced this issue Apr 14, 2012
Cleaned up the Game Entity code a lot - added comments, moved things to be
in more logical places, and did some other general care. Refs #12,
although this is far from complete. I also got rid of the object cache,
preferring static collections per object type. Need to do some more
caretaking to make sure that you don't accidentally recycle objects of the
wrong type (ie. call GameEntity.RecycleEntity on a ChestEntity), but this
is a start.

I also added a bunch of comments on the Constants file, and removed unused
constants.
@mdkess
Copy link
Owner Author

mdkess commented May 8, 2012

I've been just adding some boilerplate object pool code to each object. Annoying, yes, but it gets the job done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant