-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
feat(THL): ByteBuffer implementation for THL Serialization #4933
base: develop
Are you sure you want to change the base?
Conversation
@DarkWeird we might want to use this for encoding chunk data. https://en.wikipedia.org/wiki/LEB128 can we move this into gestalt. If its fast enough I would opt to also do this for chunk data and we can version the format to manage this :P. |
Why no? Simple variable length int. LEB128 like Protobuf's varint/varlong Int array = 4 * size. and 4 * index. |
* add tests * add benchmarks * add dummy ObjectStream impl for InMemory Serializer * add ByteBuffer as target serializer to serializers
6b967d5
to
c90827b
Compare
@pollend what you did? |
...rc/main/java/org/terasology/persistence/typeHandling/bytebuffer/ByteBufferPersistedData.java
Outdated
Show resolved
Hide resolved
...rc/main/java/org/terasology/persistence/typeHandling/bytebuffer/ByteBufferPersistedData.java
Outdated
Show resolved
Hide resolved
return type == BBType.FLOAT | ||
|| type == BBType.DOUBLE | ||
|| type == BBType.INTEGER | ||
|| type == BBType.LONG; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can define all this encoding information in BBType
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah. but not directly.
I cannot use enum values in same enum 'constructors'
Another variant, i can provide something like capabilities.. but it is will mess NULL(0,false,false,false,false,false,true)
or switches... switches... switches in methods..
...in/java/org/terasology/persistence/typeHandling/bytebuffer/ByteBufferPersistedDataArray.java
Outdated
Show resolved
Hide resolved
...eHandlerLibrary/src/main/java/org/terasology/persistence/typeHandling/bytebuffer/BBType.java
Show resolved
Hide resolved
...rc/main/java/org/terasology/persistence/typeHandling/bytebuffer/ByteBufferPersistedData.java
Outdated
Show resolved
Hide resolved
...rc/main/java/org/terasology/persistence/typeHandling/bytebuffer/ByteBufferPersistedData.java
Outdated
Show resolved
Hide resolved
I rebaesed the changes |
Contains
THL Serialization - ByteBuffer.
Minimal binary format integrated with THL.
Profits:
Cons:
It can replaces Protobuf at network and savings.
It can be extracted to gestalt and can be reused in DS.
How to test
Outstanding before merging