jupyter-widgets-contrib / ipycanvas

Interactive Canvas in Jupyter
https://ipycanvas.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
686 stars 64 forks source link

orjson is not compatible with PyPy #201

Closed stonebig closed 3 years ago

stonebig commented 3 years ago

could ipycanvas rely on something else than orjson when running on PyPy ?

orjson is not compatible with PyPy https://github.com/ijl/orjson#will-it-support-pypy

martinRenou commented 3 years ago

Thanks for opening this issue.

Another reason for getting rid of orjson is compatibility with jupyterlite, ipycanvas won't be installable on jupyterlite unless orjson is not a dependency.

The problem is orjson is super fast, so maybe we should not make it a hard dependency, and fallback on another JSON library if it's not found, but still use it if it's found.

martinRenou commented 3 years ago

Would rapidjson be a good replacement in your opinion?

stonebig commented 3 years ago

I need something compatible with pypy3.7 on Windows.

Performance is not the concern.

It's all about the belief that to go x5 speed up on cpython, the recipe needed for pypy3 will have to be applied, so working on pypy3 compatibility is a bijection with working on cpython performance

martinRenou commented 3 years ago

I implemented a fallback to the Python standard json library. I understand pypy's json library should be faster.

I've never looked into building a pypy package on conda-forge. Is it something you'd be able/willing to work on?

stonebig commented 3 years ago

I'm not on conda. I'm on pypi.