News: 1652711408

  ARM Give a man a fire and he's warm for a day, but set fire to him and he's warm for the rest of his life (Terry Pratchett, Jingo)

Python is getting faster: Major performance tweaks on horizon

(2022/05/16)


The next version of the standard Python interpreter, CPython, is expected in October. It will include significant performance improvements and support for running inside the browser.

Last week, the first Python language summit since 2019 took place in Salt Lake City. At the event, the language's development team announced various changes for the forthcoming version of the language, as well as its near future. The Reg has [1]covered some future improvements before , and as they get closer, details are becoming clear, as well as what's coming in Python 3.12.

There are multiple editions of Python out there, including interpreters for the JVM and .NET CLR, as well as compilers, but the core implementation of the language is the CPython interpreter. This has some well-known limitations, including the Global Interpreter Lock or [2]GIL , which prevents the language from taking full advantage of multicore processors.

[3]

It has long been possible for a single process to contain several interpreters, but they interfere with one another because they all must share the single GIL. Eric Snow's [4]effort to resolve this is the per-interpreter GIL: to give each interpreter its own GIL.

[5]

[6]

A broader solution would be to remove the GIL altogether. A previous effort to do this, Larry Hastings' [7]GILectomy , stalled, but a new one has already gone further and may yet succeed. The new feature is simply called [8]nogil and is being worked on by Meta developer Sam Gross.

This isn't the first time that the Facebook owner [9]has contributed go-faster changes . Apparently, [10]Meta owned Instagram uses Python very heavily and runs on an internal version called [11]Cinder , but this is specialized for the company's needs and isn't for general consumption. The new [12]effort should be more widely applicable.

[13]SAS backs Python as alternative to its own language

[14]User-built low-code apps tipped to dominate analytics by 2025

[15]Oracle offers migration path for Solaris 10 apps

[16]GitHub's Dependabot learns to report bad news you can use

These changes may be in small part due to another industry giant. Back in 2018, Python Benevolent Dictator For Life [17]Guido van Rossum retired , but a couple of years later, he changed his mind and [18]returned to work – at Microsoft .

With Microsoft paying the wages of Van Rossum and [19]Mark Shannon , along with some money from [20]Bloomberg and others , the [21]HotPy project is making progress. So far, the beta of CPython 3.11 is on average about 25 percent [22]faster in [23]benchmarking .

Python services

Over on our sister site, [24]DevClass , You can read an interview with Pablo Galindo, a software engineer at Bloomberg and release manager for Python 3.11, about Memray – a memory profiler for Python that analyzes both Python and native code.

The speedup project also has a [25]roadmap of future changes, and the Python Software Foundation's [26]blog explains the plans in more detail. ®

Get our [27]Tech Resources



[1] https://www.theregister.com/2021/05/13/guido_van_rossum_cpython_3_11/

[2] https://wiki.python.org/moin/GlobalInterpreterLock

[3] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/front&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=2&c=2YoJ1IrDuopsu5vqJcuV7nAAAAEU&t=ct%3Dns%26unitnum%3D2%26raptor%3Dcondor%26pos%3Dtop%26test%3D0

[4] https://pyfound.blogspot.com/2022/05/the-2022-python-language-summit-per.html

[5] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/front&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=4&c=44YoJ1IrDuopsu5vqJcuV7nAAAAEU&t=ct%3Dns%26unitnum%3D4%26raptor%3Dfalcon%26pos%3Dmid%26test%3D0

[6] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/front&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=3&c=33YoJ1IrDuopsu5vqJcuV7nAAAAEU&t=ct%3Dns%26unitnum%3D3%26raptor%3Deagle%26pos%3Dmid%26test%3D0

[7] https://github.com/larryhastings/gilectomy

[8] https://github.com/colesbury/nogil

[9] https://www.theregister.com/2021/05/06/the_quest_for_faster_python/

[10] https://www.theregister.com/2012/08/23/ftc_approves_facebook_buyout_of_instagram/

[11] https://github.com/facebookincubator/cinder

[12] https://pyfound.blogspot.com/2022/05/the-2022-python-language-summit-python_11.html

[13] https://www.theregister.com/2022/05/11/sas_python_support/

[14] https://www.theregister.com/2022/05/12/userbuilt_lowcode_apps_to_dominate/

[15] https://www.theregister.com/2022/05/02/solaris_10_software_migration_tool/

[16] https://www.theregister.com/2022/04/15/githubs_dependabot_security/

[17] https://www.theregister.com/2018/08/20/python_wriggles_onward/

[18] https://www.theregister.com/2020/11/12/python_swallows_java_to_become/

[19] https://www.linkedin.com/in/mark-shannon-bb459551/

[20] https://devclass.com/2022/05/12/core-dev-memray-memory-profiler/

[21] https://sites.google.com/site/makingcpythonfast/

[22] https://docs.python.org/3.11/whatsnew/3.11.html#faster-cpython

[23] https://github.com/faster-cpython/ideas/blob/main/main-vs-310.rst

[24] https://devclass.com/2022/05/12/core-dev-memray-memory-profiler/

[25] https://github.com/markshannon/faster-cpython/blob/master/plan.md

[26] https://pyfound.blogspot.com/2022/05/the-2022-python-language-summit_2.html

[27] https://whitepapers.theregister.com/



Microsoft Python 3.11

John Robson

What could go wrong?

Re: Microsoft Python 3.11

Anonymous Coward

A Black Mamba can slither at 12 mph, they are shy but they would be much harder to run past than a Python which just wants to give you a hug.

Fortune finishes the great quotations, #6

"But, soft! What light through yonder window breaks?"
It's nothing, honey. Go back to sleep.