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

investigate higher performance serialization #1

Open
paddymul opened this issue Dec 29, 2023 · 1 comment
Open

investigate higher performance serialization #1

paddymul opened this issue Dec 29, 2023 · 1 comment

Comments

@paddymul
Copy link

JSON serialization is generally pretty slow from the python side. There are also types that JS and python are capable of expressing that aren't available in JSON (infinity, NaN, NaT).

I have written half baked versions of this code many times. I would love to see a well thought out JSON serialization function not deeply tied to a larger package.

Take a look at how ipydatagrid handles this
https://github.com/bloomberg/ipydatagrid/blob/main/ipydatagrid/datagrid.py#L168-L193

When you start worrying about performance, you will want some type of binary serialization. I think parquet-wasm or arrow-js are probably the best avenues. This could handle a bunch of the edge type issues. The performance will also be much better especially from the python side. I wrote some very rough benchmarks for pandas , polars was 2-4x faster than pandas, but parquet was 100x faster.

@deanm0000
Copy link
Owner

Hey thanks for the interest.

I've got serialization improvement on my list of aspirations. For graphs that are only 1 way Python to js in a notebook is probably not going to really be noticeably slow to justify spending too much time on it. We'll see.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants