-
Notifications
You must be signed in to change notification settings - Fork 164
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
Omit property names #130
Comments
From a quick search, this project seems to be the closest match for the api above: https://github.com/sitegui/js-binary |
As you said, decoding keys is very slow, so this library already has a mechanism to cache short keys contributed by @sergeyzenchenko: You can see a cache-hit rate by running
Of course, better implementation is always welcome. |
Schema-based serialization should be useful for robust systems, by the way. I'd like to design it after https://github.com/tc39/proposal-decorators is standardized (see also #91). |
@gfx #54 is a really nice performance boost, but if I understand correctly it still requires sending keys over the wire? I'm mostly interested in being able to reduce the payload size by not including the keys at all, and instead reconstruct the keys from a static schema provided to the decoder. For my use case, this would greatly optimize network bandwidth usage! |
I see. It makes sense, but in such a case, I recommend ProtocolBuffers, which is designed in the very case and has tools to maintain the schema. |
Yeah I've also been meaning to explore https://github.com/mtth/avsc, which has some pretty impressive benchmark numbers in comparison to protobufjs |
@hpx7 could you please share what you picked in the end? And whether it worked well for you. Also, you might be interested in msgpackr which claims better performance than this library and avsc (btw it’s not surprising avsc isn’t fast given their desire to keep additional dependencies to support node 0.x) |
I'm using msgpack to transmit objects with a fixed schema, so it feels wasteful to encode the property names with each payload. Is there some way to provide some schema information to the encoder/decoder during initialization so that property names can be excluded from the serialization output?
Proposal of what this api could look potentially like:
The text was updated successfully, but these errors were encountered: