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
est
V2EX  ›  Python

Windows Subsystem for Linux 上的 Python 比 Python .exe 快 50%

  •  
  •   est ·
    est · 2017-07-31 23:18:12 +08:00 · 2645 次点击
    这是一个创建于 2465 天前的主题,其中的信息可能已经有所发展或是发生改变。
    8 条回复    2017-08-01 18:30:38 +08:00
    myliyifei
        1
    myliyifei  
       2017-07-31 23:28:24 +08:00 via Android
    为什么呢
    ipconfiger
        2
    ipconfiger  
       2017-07-31 23:35:25 +08:00
    迷之 50%
    rosu
        3
    rosu  
       2017-07-31 23:44:40 +08:00 via Android
    一使用 Subsystem,Android Studio 的模拟器就出错?😳
    tempdban
        4
    tempdban  
       2017-07-31 23:54:06 +08:00 via Android
    应该是 c 库的差异吧
    wenzhoou
        5
    wenzhoou  
       2017-08-01 07:39:18 +08:00 via Android   ❤️ 1
    只有一个样本不叫测试。也许是一部分 API 快,一部分 API 慢呢。
    flynaj
        6
    flynaj  
       2017-08-01 11:02:37 +08:00 via Android
    Windows Subsystem for Linux 跟 linux 环境差别很大建议还是少折腾,50%应该是线程同步的问题
    lrxiao
        7
    lrxiao  
       2017-08-01 13:04:50 +08:00
    昨天也看到这个...

    有人说是 MSVC 和 Gcc 的问题 有人说是源码编译更好, 很迷
    ysc3839
        8
    ysc3839  
       2017-08-01 18:30:38 +08:00
    > python3.exe -c "import sys; print(sys.version)"
    3.6.2 (v3.6.2:5fd33b5, Jul 8 2017, 04:57:36) [MSC v.1900 64 bit (AMD64)]

    > python3.exe -m test.pystone 5000000
    Pystone(1.2) time for 5000000 passes = 38.1625
    This machine benchmarks at 131019 pystones/second


    $ python3 -c "import sys; print(sys.version)"
    3.5.2 (default, Nov 17 2016, 17:05:23)
    [GCC 5.4.0 20160609]

    $ python3 -m test.pystone 5000000
    Pystone(1.2) time for 5000000 passes = 36.8147
    This machine benchmarks at 135815 pystones/second

    确实有差距,但没那帖子那么夸张。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2179 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 60ms · UTC 11:01 · PVG 19:01 · LAX 04:01 · JFK 07:01
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.