Jump to content
  • Advertisement
Sign in to follow this  
Anfaenger

Implementing an efficient memory cache (or choosing an existing library)

This topic is 418 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi!

I'm writing a procedural voxel->polygon engine and I need to frequently generate/save/load and destroy chunks.

I'd like to avoid regenerating, and especially loading (== touching the disk) chunks, which have been recently used, by employing a memory cache.

Ideally, I'd like to reserve a fixed-size memory block for the 'chunk cache', address cached chunks by their IDs and specify chunk eviction policy/expiration time.

 

How to best implement such a cache? (i.e. fast and efficient, no fragmentation.)

Could you give me any references to existing implementations?

 

I found these libraries, but they seem too 'heavy' for my toy voxel engine:

http://cachelot.io/ and memcached

Is there anything more lightweight?

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!