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

Chunk storage - new attempt #417

Merged
merged 13 commits into from Jan 16, 2013
Merged

Conversation

mbrotz
Copy link
Contributor

@mbrotz mbrotz commented Jan 15, 2013

Let's try it again! :) I have created this new branch called "chunk-storage", which is based on the latest develop branch, and cherry picked my latest changes into it. I hope, it works like this and is acceptable for you.

Original pull request: #409


I've implemented protobuf support for TeraArrays and Chunks.

Enocoding and decoding of TeraArrays:

  • TeraArrays.getInstance().encode(TeraArray)
  • TeraArrays.getInstance().decode(ChunksProtobuf.TeraArray)

Encoding and decoding of Chunks:

  • Chunks.getInstance().encode(Chunk)
  • Chunks.getInstance().decode(ChunksProtobuf.Chunk)

Further i've added a new chunk store which internally uses protobuf to store chunks. I haven't made any benchmarks yet, but i get the feeling that the new chunk store is faster than the old one. And it definitly yields slightly better compression for chunks and entire worlds.

I think, existing worlds which were created using the old chunk store should still work! They just keep using the old chunk store when you load them. At least, it works on my machine. I hope, it works on yours too, i don't have very old worlds to test it against...

I can add a conversion mechanism so your old worlds can switch to the new chunk store.

Maybe someone can test, wether old worlds still work? Don't forget to backup your old worlds!

+ added interface TeraArraySerializationHandler<T extends TeraArray>
+ added abstract base class TeraArray.SerializationHandler<T extends TeraArray>
+ added interface TeraArrayFactory<T extends TeraArray>
* changed class Chunk to use the new factories
* changed class AdvancedConfig to use the new factories
… array

+ implemented benchmarks for different ways of serializing tera arrays
+ added Chunks.proto describing simple messages for chunks and tera arrays
- removed stream based serialization handlers due to massive performance problems
…n for protobuf

+ added protobuf file implementing messages for chunks and tera arrays
…dlers

+ implemented TeraArray.encode(TeraArray) which encodes the supplied tera array into a protobuf message
+ implemented TeraArray.decode(ChunksProtobuf.TeraArray) which decodes the supplied protobuf message into a tera array
* added a type identifier to the protobuf message for future use in mod supplied tera array implementations
+ added class TeraArrayUtils which contains the former methods of class TeraArrays
* improved the implementation of the tera array registry (class TeraArrays)
* changed class UIMenuConfigAdvanced to use the new tera array registry
* changed class AdvancedConfig to use the new tera array registry
…tore new worlds.

+ added Chunks class which is responsible for mod extensions of chunk data and supports encoding and decoding of chunks into protobuf messages
+ added interface ProtobufHandler<T, M> to implement encoders and decoders for protobuf messages
+ added static class ProtobufHandler to Chunk class
+ added ChunkStoreProtobuf which uses protobuf internally to store chunks

* internally renamed the liquid data into extra data
* added checks to AdvancedConfig to make sure it does not throw if some settings can't be found
* updated Chunks.proto to support mod extensions of chunk data
* updated WorldRenderer to use ChunkStoreProtobuf instead of ChunkStoreGZip
…ance() to retrieve the singleton.

* changed classes WorldRenderer, ChunkStoreGZip and ChunkStoreProtobuf to support old worlds which still use ChunkStoreGZip
+ added some comments
Cervator added a commit that referenced this pull request Jan 16, 2013
@Cervator Cervator merged commit 96491d8 into MovingBlocks:develop Jan 16, 2013
@Cervator
Copy link
Member

Looks good, doesn't crash, I'll have to take your hunch for granted on the actual performance improvements though, I'm not sensitive enough to notice :D

@mbrotz
Copy link
Contributor Author

mbrotz commented Jan 16, 2013

Cool, thanks! I am implementing some benchmarks and will push them as soon as they are finished.

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

Successfully merging this pull request may close these issues.

None yet

2 participants