Skip to content
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

Switch to @msgpack/msgpack-javascript #2394

Open
fonsp opened this issue Nov 25, 2022 · 3 comments
Open

Switch to @msgpack/msgpack-javascript #2394

fonsp opened this issue Nov 25, 2022 · 3 comments
Labels
enhancement New feature or request frontend Concerning the HTML editor good first issue Good for newcomers performance

Comments

@fonsp
Copy link
Owner

fonsp commented Nov 25, 2022

Right now we are using https://github.com/kawanet/msgpack-lite for the JS side of our MsgPack protocol, or actually, my fork fonsp/msgpack-lite@6990011 where i directly edited the .min.js bundle to become an ES6 file 😅

It's working great, and I think it is quite fast.

We could switch to https://github.com/msgpack/msgpack-javascript , which is being actively developed, and more modern: it is written for ES6.

@fonsp fonsp added enhancement New feature or request frontend Concerning the HTML editor one day Closed because we won't work on it soon, will be opened again later. labels Nov 25, 2022
@fonsp fonsp closed this as completed Nov 25, 2022
@fonsp
Copy link
Owner Author

fonsp commented Nov 28, 2022

Since this is performance-sensitive, we need a benchmark before making the switch

@fonsp
Copy link
Owner Author

fonsp commented Nov 30, 2022

Simon Danisch was working with https://github.com/msgpack/msgpack-javascript and he found that they avoid some allocations: e.g. when part of a message is a Uint8Array, that array will actually have a larger buffer as underlying data, but it uses the byteOffset and byteLength.

Our package gives the buffer already sliced, which must mean that we have more allocations! 🙄

@fonsp
Copy link
Owner Author

fonsp commented May 16, 2023

According to their benchmark, they have a 2-3x performance increase compared to msgpack-lite!

They also have streaming API (using https://web.dev/streams/ ?) which should give even more speedups.

@fonsp fonsp reopened this May 16, 2023
@fonsp fonsp added good first issue Good for newcomers performance and removed one day Closed because we won't work on it soon, will be opened again later. labels May 16, 2023
@fonsp fonsp changed the title Maybe switch to @msgpack/msgpack-javascript Switch to @msgpack/msgpack-javascript May 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request frontend Concerning the HTML editor good first issue Good for newcomers performance
Projects
None yet
Development

No branches or pull requests

1 participant