明年 Python 至少提速 2倍 ?

浅谈武术擂台格斗机器人大赛 武术擂台机器人赛是工科类专业的一个跨学科的竞赛项目,它涵盖了机械结构、硬件电路和计算机程序等技术领域。笔者在校期间有幸参加过四次这样的比赛,有成功也有失败,对此深有感悟。本文仅为个人观点,有说得不对的地方,望积极指出,希望能帮助到有需要的人。 阅读详情

点击上方“编程派”,选择设为“设为星标”

优质文章,第一时间送达!

去年 11 月,退休失败的 Python 之父 Guido van Rossum 在推特上宣布,退休生活太无聊,从而加入了微软开发者部门。微软自然支持优秀人才的发展,所以赋予了 Guido van Rossum “自由选择项目”的权利,Guido van Rossum 也表示会致力于“确保更好地使用 Python”。

彼时,相信不少人认为 Guido van Rossum 的这句“更好”不过是官宣时的“常用说法”,可在上周的 PyCon 语言峰会上,Guido van Rossum 证明了他那句话不是说说而已:要让 Python 成为更快的语言,承诺在明年的 Python 3.11 中要将其速度提高 2 倍,以解决 Python 与 C++ 等其他编程语言相比在速度上的关键缺点。

4 年把 Python 速度提升 5 倍

Guido van Rossum 在峰会上展示了一份提交至 GitHub 的 PDF,详细说明了他对于提高 Python 速度的决心与规划。(PDF 地址:https://github.com/faster-cpython/ideas/blob/main/FasterCPythonDark.pdf)

Guido van Rossum 介绍道,这个项目名为“Shannon Plan”,由微软资助的一个小团队负责,除了他还包括 Python Core 开发人员和微软高级软件工程师Eric Snow 以及 Semmle 的研究工程师 Mark Shannon,其中 Mark Shannon 主要开发用于代码安全性分析的产品,并且在去年十月就已经开始提出了这项给 Python 提速的计划,因此本次项目的命名也取自于他的名字“Shannon”。

据 Guido van Rossum 在演讲中所说,“Shannon Plan” 项目将全程在 GitHub 开源,并且将基于 Mark Shannon 此前有关 HotPy 和 HotPy 2(针对 CPython 的即时编译器)的开发经验,承诺将在 4 年内把 Python 速度提升 5 倍,即每年约提升 1.5 倍。

以此为目标,Guido van Rossum 表示计划于明年发布的 Python 3.11 版本实现提升 2 倍的速度。他还大致解释了团队需要为此做出的努力:

  • 适应性、专门的字节码解释器(类似于内联缓存,但功能更全面)

  • 各种其他单独的优化:例如优化帧堆栈、调用更快、调整分配,还有“零开销”异常处理

不过 Guido van Rossum 也没有把话说的太死,因为提速实际上存在许多限制,包括不能破坏稳定的 ABI(应用程序二进制接口)兼容性、不能破坏 API 的兼容性、要保持代码兼容可维护以及在极端情况下不能降低速度等难题。

所以大概是为了避免意外,他补充道:“我们并不能确定我们肯定会达到 2 倍!只是乐观计划。”

微软持续助力 Python 发展

除了这个“Shannon Plan”,微软还资助了一支专门“负责解释语言的性能改进”的 Python 团队。其实不难看出,近年来微软一直都在深度拥抱开源,也很支持 Python 的发展。其中包括:发布免费的 Python 课程、通过 VS Code Python 扩展在 Windows 10 及以上版本均支持 Python。此外,微软自 2006 年起就成为了 Python 软件基金会(PSF)的正式赞助商,不说曾经,仅今年就已经提供了 15 万美元的赞助费。

微软 Python 与 AI 工具首席经理 Dan Taylor 对此曾表示:“作为提供给 PSF 15 万美元财务赞助中的一部分,我们将把资金集中到程序包工作小组当中,帮助他们进一步改善 PyPI 与程序包生态系统。”

不仅如此,微软内部目前也有 5 个为 CPython 开发做出贡献的核心开发人员,包括:Brett Cannon,Steve Dower,Guido van Rossum,Eric Snow 和 Barry Warsaw,他们全部都是 Python 核心开发者社区中的资深人士。

总体看来,不论是资金还是技术,微软对 Python 的支持可谓全面,或许这也促成了 Python 之父 Guido van Rossum 在退休后选择进入微软的部分原因。正如当初他在推特宣布加入微软的时候,最后提了一句“这里(微软)有很多开源”,微软对 Python 的助力、对开源的支持他都看得见。

因而在峰会的演讲中,Guido van Rossum 指出:我选择回到我的根源,这也是微软回馈 Python 的方式。


本文转载自CSDN,链接:https://mp.weixin.qq.com/s/TCA5ZwPwvM60kE9JX83j7g

—END—

题图:pexels,CC0 授权。

大数据面试必考题:Spark数据倾斜问题总结和优化措施 在Spark分布式计算环境中, 阅读详情

相关推荐

WRF-Chem新手避坑指南:从chem_opt到emiss_opt,那些手册里没明说的参数配置实战

本文为WRF-Chem新手提供从chem_opt到emiss_opt的参数配置实战指南,解析官方文档中未明确的常见陷阱与解决方案。通过华北重霾案例,详细讲解化学机制选择、排放源配置及特殊参数组合的注意事项,帮助用户避开常见错误,提升模拟效率。

weixin_30897079的博客 285

Python运行速度慢?5个优化方案提速100%!

Python运行速度慢?5个优化方案提速100%!不信你试试

python03012的博客 4830

Air780E模组AT指令实战:5分钟搞定MQTT连接EMQX服务器(附完整代码)

本文详细介绍了如何使用Air780E 4G模组通过AT指令快速连接MQTT服务器。从硬件接线、网络注册到MQTT连接配置,提供了完整的实战步骤和代码示例,帮助开发者快速实现物联网设备的数据上报与远程通信。

wdx012345的博客 750

这8种 Python 加速运行技巧真棒

Python 是一种脚本语言,相比 C/C++ 这样的编译语言,在效率和性能方面存在一些不足。但是,有很多时候,Python 的效率并没有想象中的那么夸张。本文对一些 Python 代码加速运行的技巧进行整理。

程序员小麦的博客 1185

日志异常检测详细整理,看这一篇就够了(附各项目代码链接)

对于不用的日志键,用它们的参数值向量训练一个参数值异常检测模型来检测有这些参数值反映的系统性能异常。与标准的GAN框架一样,D和G的参数是基于D的输出来更新的,因此鉴别器D可以被训练为尽可能敏感地将正确的标签分配给真实和虚假序列,而生成器将被训练为尽可能聪明地在经过足够多轮的迭代后欺骗鉴别器,即误导D将真实标签分配给虚假序列。LR:逻辑回归是有监督的模型,将处理后的特征矩阵以及标记作为模型的输入,得到训练后的模型,用此模型预测新出现的特征向量,以此判断特征向量是否为异常的,进而判断日志异常。

qq_20368489的博客 1万+

创龙 瑞芯微 RK3588 国产2.4GHz八核 工业开发板—ISP图像处理开发案例

创龙科技研发的 TL3588-EVM 评估板具备强大视频处理能力,可满足多场景视频开发需求。为助力开发者快速上手,本文整理 7 个实用视频开发案例,涵盖从采集到显示的全流程,详细说明各案例的硬件连接、参数配置与代码解析,帮助开发者高效实现评估板视频相关功能开发与调试。

创龙,嵌入式一体化解决方案商 222

24招加速你的Python,超级实用!

云哥前期从以下九个方面讨论了加速Python的具体方法,一共24个,每个都带有优化前后的对比,非常实用。分析代码运行时间加速查找加速循环加速函数实用标准库加速Numpy向...

算法channel 869

ESP32-C3入门教程 问题篇⑳——subprocess.CalledProcessError: Command ‘[‘D:\\.espressif\\python_env\\idf5.4_py3.

ESP32-C3入门教程 问题篇⑳——subprocess.CalledProcessError: Command '['D:\\.espressif\\python_env\\idf5.4_py3.

777

6个技巧帮你提高Python运行效率

随着国内对人工智能领域发展的大力支持,Python编程语言成为国内使用增长率的最大的编程语言。越来越多的人加入Python的学习行列,企业对Python的使用也越来越普遍。Python能够让你在端时间内通过少量代码,实现大量的操作。这里小编整理了6个Python编程技巧,帮你提高Python的运行效率。

2201_75362610的博客 4605

继电器控制LED灯具导致触点烧蚀粘连的解决办法

继电器控制LED灯具导致触点烧蚀粘连的解决办法

2705

【人工智能之深度学习】23. 推荐系统升级实战:LightGCN重构协同过滤全流程(Amazon-Beauty数据集+完整代码)

摘要:传统协同过滤(如矩阵分解)在电商推荐中存在三大痛点:忽略用户-物品高阶关联、交互数据稀疏导致冷启动、特征工程依赖人工设计。本文基于Amazon-Beauty数据集(含20万+用户交互),用LightGCN图神经网络重构推荐系统:1)构建用户-物品二部图,通过3层图卷积捕捉“用户→物品→用户”的多跳关联;2)采用BPR负采样损失优化嵌入学习,缓解数据稀疏;3)端到端输出用户/物品嵌入,无需人工特征。

专注于人工智能、软件开发、工控自动化、工厂数字化及智能化等领域,希望和大家共同进步! 1502

24招加速你的Python,超级实用

从以下九个方面讨论了加速Python的具体方法,一共24个,每个都带有优化前后的对比,非常实用。我在此基础上 主要美化了编辑 ,方便读者更容易阅读学习。

m0_58477260的博客 2718

win10 跳过U8环境检测的IE WebControls.rar

win10 安装u8的时候 提示IE WebControls 不通过,这个工具可以欺骗u8的检查。 跳过U8环境检测的IE WebControls。提示导入失败后,重新检测通过。

明年至少令 Python 提速 2倍 ? Python之父给出爆料

去年 11 月,退休失败的 Python 之父 Guido van Rossum 在推特上宣布,退休生活太无聊,从而加入了微软开发者部门。微软自然支持优秀人才的发展,所以赋予了 Guido van Rossum “自由选择项目”的权利,Guido van Rossum 也表示会致力于“确保更好地使用 Python”。 彼时,相信不少人认为 Guido van Rossum 的这句“更好”不过是官宣时的“常用说法”,可在上周的 PyCon 语言峰会上,Guido van Rossum 证明了他那句话不是说说而

weixin_56659172的博客 218

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

VB摄像头监控

该VB模块可对摄像头捕获的画面进行录像等,可在创建的窗口进行控制

Python 之父爆料:明年至少令 Python 提速 1 倍!

这是「进击的Coder」的第 422篇技术分享作者:豌豆花下猫来源:Python猫“ 阅读本文大概需要 2 分钟。 ”大概在半年前,我偶然看到一篇文章,有人提出了给 Python 提...

静觅 190

精雕软件(JDpaint) 5.5 绿色版

精雕软件(JDpaint) 5.5 绿色版精雕软件(JDpaint) 5.5 绿色版精雕软件(JDpaint) 5.5 绿色版

Python 之父立 Flag:明年要把 Python 速度提高 2 倍!

????????关注后回复“进群”,拉你进程序员交流群????????整理 | 郑丽媛出品 | CSDN(ID:CSDNnews)去年 11 月,退休失败的 Python 之父 Gui...

<sdffdsfsdfdfs>sfsfsfsdfsdffds</sdfsDS>Fsd 144

Python之父:明年让Python快2倍

点击上方“视学算法”,选择加"星标"或“置顶”重磅干货,第一时间送达博雯 发自 凹非寺 量子位 报道 | 公众号 QbitAI5月中旬刚刚结束的Pycon US 2021上...

zandaoguang的博客 130
上一篇: 学霸是怎么用微信机器人的?
下一篇: VS Code 高效“摸鱼”插件推荐
codingpy
博客等级 码龄11年 1892粉丝 104原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值
⌂ 换网址