V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
mimzy
V2EX  ›  Python

pydantic V2 将核心功能拆解到使用 Rust 实现的 pydantic-core,目标带来 10 倍以上的性能提升

  •  3
     
  •   mimzy ·
    mookrs · 2022-11-03 01:06:06 +08:00 · 2663 次点击
    这是一个创建于 512 天前的主题,其中的信息可能已经有所发展或是发生改变。

    已经合并到 main 分支 https://github.com/pydantic/pydantic/pull/4516

    Benchmarks https://github.com/pydantic/pydantic-core/tree/main/tests/benchmarks

    一点感想:像 orjson 这种用 Rust 来写的 Python 库可能会越来越多了…

    7 条回复    2022-11-03 17:22:29 +08:00
    junkun
        1
    junkun  
       2022-11-03 01:41:41 +08:00
    python 本来很多库,包括标准库,都是 c/c++写的。既然很多 c/c++的项目都被 rust 取代了,python 库自然也有很多会被 rust 取代。
    wzw
        2
    wzw  
       2022-11-03 08:27:30 +08:00 via iPhone
    期待正式发布
    vicalloy
        3
    vicalloy  
       2022-11-03 08:53:08 +08:00
    主要还是用 Python 来做算法实在是太慢了。
    janxin
        4
    janxin  
       2022-11-03 08:57:33 +08:00
    为什么不这么想:Python 作为胶水语言的第二春
    fcfangcc
        5
    fcfangcc  
       2022-11-03 09:08:43 +08:00   ❤️ 1
    为 pydantic_core 提过代码的路过- - rust+py 感觉可以通杀所有场景了
    alexsunxl
        6
    alexsunxl  
       2022-11-03 10:52:29 +08:00
    cool
    yyfearth
        7
    yyfearth  
       2022-11-03 17:22:29 +08:00
    另外 Rust + TS/JS 可以做全栈
    Rust 可以编译成 wasm 直接在浏览器里面跑
    服务器端 NodeJS 性能不够了可以和 Py 一样用 Rust 加速
    看下 deno 有没有可能取代 node
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1067 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 19:01 · PVG 03:01 · LAX 12:01 · JFK 15:01
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.