GithubHelp home page GithubHelp logo

Omit property names about msgpack-javascript HOT 7 OPEN

msgpack avatar msgpack commented on May 19, 2024
Omit property names

from msgpack-javascript.

Comments (7)

hpx7 avatar hpx7 commented on May 19, 2024

From a quick search, this project seems to be the closest match for the api above: https://github.com/sitegui/js-binary

from msgpack-javascript.

gfx avatar gfx commented on May 19, 2024

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 benchmark/benchmark-from-msgpack-lite.ts with CACHE_HIT_RATE=1:

CACHE_HIT_RATE=1 npx ts-node benchmark/benchmark-from-msgpack-lite.ts
...
CACHE_HIT_RATE: cache hit rate in CachedKeyDecoder: hit=36318175, miss=25, hit rate=0.9999993116398941

Of course, better implementation is always welcome.

from msgpack-javascript.

gfx avatar gfx commented on May 19, 2024

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).

from msgpack-javascript.

hpx7 avatar hpx7 commented on May 19, 2024

@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!

from msgpack-javascript.

gfx avatar gfx commented on May 19, 2024

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.

from msgpack-javascript.

hpx7 avatar hpx7 commented on May 19, 2024

Yeah I've also been meaning to explore https://github.com/mtth/avsc, which has some pretty impressive benchmark numbers in comparison to protobufjs

from msgpack-javascript.

o-alexandrov avatar o-alexandrov commented on May 19, 2024

@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)

from msgpack-javascript.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.