daangn / urlpack

Pure JavaScript toolkit for data URLs (MessagePack, Base58 and Base62)
MIT License
58 stars 4 forks source link

msgpack: Improve decoding performance #1

Closed cometkim closed 3 years ago

cometkim commented 3 years ago

@urlpack/msgpack implementation has poor decoding performance compared to other libraries.

This is because we use slice() to copy the new array to windowing the buffer for every step, which is very inefficient.

Ideally, the decoding process can be completed in a single iteration without copy using a state machine.