Skip to content

Conversation

@gfx
Copy link
Member

@gfx gfx commented May 6, 2019

Introduce decodeAsync(buffers: AsyncIterable<ArrayLike<number> | Uint8Array>) to decode streams, which leads Decoder to be resumable with little overheads, although the code becomes somewhat complex.

bencmark

Benchmark on NodeJS/v12.1.0

operation op ms op/s
buf = Buffer.from(JSON.stringify(obj)); 493600 5000 98720
buf = JSON.stringify(obj); 959600 5000 191920
obj = JSON.parse(buf); 346100 5000 69220
buf = require("msgpack-lite").encode(obj); 358300 5000 71660
obj = require("msgpack-lite").decode(buf); 270400 5000 54080
buf = require("@msgpack/msgpack").encode(obj); 594300 5000 118860
obj = require("@msgpack/msgpack").decode(buf); 343100 5000 68620
@gfx gfx merged commit ebd1b9c into master May 6, 2019
@gfx gfx deleted the async-decoder branch May 6, 2019 13:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants