Comments (7)
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.
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.
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.
@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.
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.
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.
@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)
- Cannot use reusable encoders/decoders in custom codecs
- [bug] decode throws RangeError on empty Uint8Array HOT 2
- raw_ref type? HOT 2
- How can we convert the msgpack-encoded str back to the origin info HOT 2
- How to solve the problem of large integer accuracy loss
- Encoder Reuse Bug? HOT 2
- Cannot find module
- RangeError: Start offset undefined is outside the bounds of the buffer HOT 3
- Non reversible timestamp encoding HOT 1
- feature request: option to disable TEXT_ENCODING env check HOT 4
- There has a way to decode extension type from another language? HOT 3
- can i override the int64 decoder?
- Invalid integer string convertion from PHP serialized .msgpack HOT 1
- error on https://msgpack.org/
- Decoding of 32 bit floats is not precise HOT 3
- npm `latest` tag on `3.0.0-beta`
- add deno example with `import 'npm:@msgpack/msgpack'` HOT 1
- Encoder / Decoder classes dont work with `new ExtensionCodec()` for handling Set and Map in typescript
- Need support bigint HOT 2
- Error in ExtensionCodec.ts?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from msgpack-javascript.