As you probably know, the GIL stands for the Global Interpreter Lock, and its job is to make the CPython interpreter thread-safe. The GIL allows only one OS thread to execute Python bytecode at any given time, and the consequence of this is that it's not possible to speed up CPU-intensive Python code by distributing the work among multiple threads. This is, however, not the only negative effect of
PEP 617 – New PEG parser for CPython Author: Guido van Rossum <guido at python.org>, Pablo Galindo <pablogsal at python.org>, Lysandros Nikolaou <lisandrosnik at gmail.com> Discussions-To: Python-Dev list Status: Final Type: Standards Track Created: 24-Mar-2020 Python-Version: 3.9 Post-History: 02-Apr-2020 Table of Contents Overview Background on LL(1) parsers Background on PEG parsers Rationale S
概要 CPythonコア開発者の@methane さんが以下のようなツイートをされていて、@methane さん曰く「簡単そう」ということなのでGWの空き時間で実装してみました。そのメモと結果をまとめます。 Pythonのメモリ消費をケチるアイデア、docstringをコンパイル時にdedentするって案があって割とコスパ良いと予想してるんだけど、だれかやってみたい人いない? — Inada Naoki (@methane) 2019年4月17日 で、これのほぼ答え的なヒントがScrapbox.ioに残されているので、それを頼りに実装してみます。 docstringのインデントを削る - CPython Development 結論だけ先に書くとまだ検証(コード修正)が必要な部分があります。一旦ここまでのメモを書き出しています(2019/05/04) 前提 OSはLinux(dockerの
2018年9月17日から18日にかけて、日本最大のPythonの祭典、PyCon JP 2018が開催されました。「ひろがるPython」をキャッチコピーに、日本だけでなく世界各地からPythonエンジニアたちが一堂に会し、様々な知見を共有します。プレゼンテーション「Rust と Python」に登壇したのは、Hideo Hattori氏。講演資料はこちら PythonとRustを使ってPythonの拡張モジュールを書くHideo Hattori(以下、Hattori):ありがとうございます。このようなお話させていただく機会をいただきまして、ありがとうございます。今日は「RustとPython」ということでお話をさせていただきます、Hattori Hideoと申します。よろしくお願いします。 自己紹介を改めてさせていただきますと、Twitter IDはhhattoというのでやっていまして、
Python 3.6 に取り込まれた dict の新実装などでコアコミッターに興味を持ってもらい、 Core Developer (要するにコミッター) に推薦しようか?という提案をもらいました。 最初はコミッターとか面倒そうだし、コミットメッセージとかNEWSエントリー(通常パッチをコミットするときにコミッターが書く)とかを英語で書くのも英語が得意な人がやったほうがいいだろうし、とりあえず github に移行するまでは様子見しておこうと思ってたのですが、 dict 関係のパッチがいくつもレビュー待ちでなかなかコミットされないのを見て「やっぱりアクティブなコミッターが全然足りてない」と考え直し、志願することに。 で、先月末にコミット権をもらった(というか push できる権限を持った hg アカウントに ssh 鍵を登録してもらった)のですが、新米コミッターは簡単なパッチでも他のコアコミ
Python 3.6b1 がリリースされましたね。(フライング) beta1 ということで、 3.6 に向けた新機能の追加は (provisional package を除いて) 終了です。ただし、仕様が確定したと言うわけではなくて、beta版に対するフィードバックを元に新機能を修正したり、最悪 revert して 3.7 に持ち越しにされる可能性もあります。 なお、 3.6b1 が出る前の1週間が core dev sprint があり、そこでめちゃくちゃ大量に大きめの変更が入りました。なので、常用環境には全くオススメできませんが、OSS開発者だったら .travis.yml に python: "nightly" を追加してリグレッションの発見に貢献したり(←これめっちゃ有り難いです)、それ以外の人も 3.6 を試してみて早めにフィードバックをしてもらえると、年末の 3.6 がより完成
[Python-Dev] Python 3.6 dict becomes compact and gets a private version; and keywords become ordered Victor Stinner victor.stinner at gmail.com Thu Sep 8 16:22:46 EDT 2016 Previous message (by thread): [Python-Dev] PEP 468 ready for pronouncement. Next message (by thread): [Python-Dev] Python 3.6 dict becomes compact and gets a private version; and keywords become ordered Messages sorted by: [ dat
Here are nine lectures walking through the internals of CPython, the canonical Python interpreter implemented in C. They were from a dynamic programming languages course that I taught in Fall 2014 at the University of Rochester. The format isn't ideal, but I haven't seen this level of detail about CPython presented online, so I wanted to share these videos. Here are nine lectures I gave on CPython
ISUCON は Go で参戦しているんだけど、複数のチームが Python で予選通過したらしいので、応援のために Tips を公開していこうと思う。 目次 CPython の GC について 統計情報を出力する 第一世代GCの間隔を調整する Out of Band GC 循環参照を見つけて対処する CPython の GC について CPython のGCは参照カウント+循環参照コレクタだ。そして参照カウント方式は(幾つかの欠点はあるものの)Webアプリのボトルネックになったりはしにくい。 なのでGCチューニングの基本は次のようになる。 循環参照を避ける 循環参照コレクタの呼び出しタイミングを制御する 循環参照コレクタは、生きているオブジェクトの数がある程度増えると第一世代が実行され、第一世代が一定回数実行されると第二世代が、第二世代が一定回数実行されると第三世代が実行される。 各世代
リストに要素を追加する処理速度の比較 前提 処理速度の比較として、Pythonの公式実装であるCPythonと、PythonのPythonによるJITコンパイラ実装であるPyPyの実行時間について比較しました。 Pythonのリスト内包表記で使った以下の3つの関数に対して、Pythonで実行時間を計測する方法 その1で定義したデコレータを用いました。 評価対象の関数 # 1. testfunc1: 空リストを用意してappend @time def testfunc1(rangelist): templist = [] for temp in rangelist: templist.append(temp) # 2. testfunc2: 1+appendをオブジェクト化 @time def testfunc2(rangelist): templist = [] append = temp
An experiment in augmented reality with lots of wooden tracks, an interactive living room experience for two kids. (about, faq) Last week, the project reached a stage where raw computation speed was a bottleneck. Originally, the generation of random inner loops with 16-18 track pieces took about half a minute, and connecting two open junctions with 14 pieces also needed a few minutes. Now with a
Are you new to open source and want to learn more about some interesting projects that you can contribute to? Join GSoC where mentors will help guide you on your journey! It is very important to reach out to the organizations that you are interested in as soon as possible. The more conversations you have with the community before you submit your proposal the better your chances of being selected i
Parsers Ply PLY is an implementation of lex and yacc parsing tools for Python. Website Docs PyParsing The pyparsing module is an alternative approach to creating and executing simple grammars, vs. the traditional lex/yacc approach, or the use of regular expressions. The pyparsing module provides a library of classes that client code uses to construct the grammar directly in Python code. Website Do
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く