看到一个 Python
的高性能 json
序列化库 —— orjson
orjson is a fast, correct JSON library for Python. It benchmarks as the fastest Python library for JSON and is more correct than the standard json library or other third-party libraries. It serializes dataclass, datetime, numpy, and UUID instances natively.
但是发现了这个库用了 rust
和 python
混合编程!!!
Python
如何调用 Rust
代码?
- 单独起一个
rust
进程然后IPC
通讯? Web Socket
通讯?jit
?
我知道了,原理就是
rust
->c API
python
<-c API
有一个专门的库:pyo3