Programming Books

Main Menu

  • Home
  • Phyton programming
  • Java programming
  • Php programming
  • C++ programming
  • Additional Topics
    • Programming industry
    • Privacy Policy
    • Terms and Conditions

Programming Books

Header Banner

Programming Books

  • Home
  • Phyton programming
  • Java programming
  • Php programming
  • C++ programming
  • Additional Topics
    • Programming industry
    • Privacy Policy
    • Terms and Conditions
Java programming
Home›Java programming›Programming languages: Python is slow, but it’s about to get faster

Programming languages: Python is slow, but it’s about to get faster

By Brandy J. Richardson
May 13, 2022
0
0

Python is incredibly popular because it’s easy to learn, versatile, and has thousands of useful libraries for data science. But one thing it isn’t is fast.

That’s about to change in Python 3.11, currently in its early beta preview (version 3.11.0b1) ahead of its stable release later this year. Core Python (CPython) developer Mark Shannon shared details about the project to make Python faster at the PyCon 2022 conference this weekwhere the developers also showed progress on the goal of running Python code in the browser.

Last year, Microsoft funded a project for the Python Software Foundation (PSF), led by Python creator Guido van Rossum and Shannon, to make Python twice as fast as the current stable 3.10 series. The vision is to push Python towards the performance of C.

SEE: How to get promoted: Five ways to climb the ladder and succeed in your career

Microsoft hired van Rossum in 2020 and gave him carte blanche to choose any project. At last year’s PyCon 2021 conference, he said he “chose to go back to my roots” and would work on Python’s famous lack of performance.

Performance may not have been a top priority for Python, as adoption has been fueled by machine learning and data science through Tensor Flow, Numpy, Pandas, and many other platforms, such as AWS Boto3 SDK for Python. These platforms are downloaded tens of millions of times per month and used in often non-hardware constrained environments.

The Faster CPython Project provided updates on the performance of CPython 3.11 over the past year. Ahead of PyCon 2022, the project released more results comparing preview beta 3.11 to 3.10 across dozens of performance metrics, showing 3.11 to be 1.25 times faster overall than 3.10.

Shannon is realistic about the project’s ability to improve Python’s performance, but thinks the improvements can extend Python’s viable use to more virtual machines.

“Python is widely known to be slow. While Python will never match the performance of low-level languages ​​like C, Fortran, or even Java, we’d like it to be competitive with fast scripting language implementations, like V8 for JavaScript. or luajit for lua,” he wrote last year in Python Enhancement Proposal (PEP) 659.

“Specifically, we want to achieve these performance goals with CPython to benefit all Python users, including those who cannot use PyPy or other alternative virtual machines.”

The key approach detailed in PEP 659 is a “specialized, adaptive interpreter that specializes code aggressively, but over a very small region, and is able to quickly and cheaply adapt to poor specialization”.

As noted, optimizations for virtual machines are “expensive”, often requiring a long “warm-up” time. To avoid this expenditure of time, the virtual machine must “assume that specialization is justified even after a few executions of a function”, so the interpreter must optimize and deoptimize continuously and very cheaply.

This should result in a faster interpreter for CPython that tracks individual bytecodes as a program runs. Work on the new interpreter is nearly complete but still requires completion of dynamic specializations for loops and binary operations, according to PSF.

Also, memory consumption in version 3.11 has not changed since version 3.10.

SEE: Developers face burnout. Here’s how companies are trying to fix it

On the question of a just-in-time (JIT) compiler for Python performance, Shannon suggested that it’s not a priority and likely won’t arrive until Python 3.13, according to the coverage of the article. event by the Python Software Foundation.

Anaconda, the creator of the Anaconda Python distribution for data science, supports the Pyston project, an implementation of Python that promises speed improvements over Python.

One of Anaconda’s oldest efforts to speed up Python was the Numba project, an LLVM-based JIT compiler for CPython, which speeds up numerical Python functions running on the CPU or GPU, but cannot optimize entire programs. and does not address the broader use of Python. case. Another is Pythonan implementation of CPython with a JIT compiler for faster performance.

According to Faster Python implementation planCPython 3.12 might gain a “simple JIT compiler for small regions” that compiles small regions of specialized code, while 3.13 would improve the compiler to extend regions for compilation.

Related posts:

  1. Goa, 13-year-old boy, manages millions of dollars in cryptocurrency | Goa News
  2. 4 “exotic” programming languages ​​popular with malware developers
  3. Intimidated by Kafka? Discover the new Confluent developer site
  4. 5 Best Java Development Companies in Vietnam

Archives

  • May 2022
  • April 2022
  • March 2022
  • February 2022
  • January 2022
  • December 2021
  • November 2021
  • October 2021
  • September 2021
  • August 2021
  • July 2021
  • June 2021
  • January 2021
  • December 2019
  • November 2019
  • October 2019
  • April 2019
  • March 2019
  • February 2019
  • January 2019
  • December 2017

Categories

  • C++ programming
  • Java programming
  • Php programming
  • Phyton programming
  • Programming industry

Recent Posts

  • 12-bit dual-channel PCIe card samples at 2x 3.2 Gsample/s
  • Woster: Need work for those stifled by student loans – Mitchell Republic
  • How to Become a Cloud Engineer
  • [Unveil]Emerging indie band SURL wants to bring rock back to the masses
  • Ansible vs. Puppet | Compare DevOps tools
  • Privacy Policy
  • Terms and Conditions