Video yükleniyor...

Video Yüklenemedi

Ana Sayfaya Dön

Finally, Python 3.14 lets you disable GIL! It's a big deal because earlier, even if you wrote multi-threaded code, Python could only run one thread at a time, giving no performance benefit. But now, Python can run your multi-threaded code in parallel. And uv fully supports it!

547,058 görüntüleme • 1 yıl önce •via X (Twitter)

34 Yorum

WhiteWoodCity profil fotoğrafı
WhiteWoodCity1 yıl önce

Java 25: Finally officially support AOT, we got performance of C Python 3.14: Finally lets u disable GIL, we got performance of 20 years ago Java

Akshay 🚀 profil fotoğrafı
Akshay 🚀1 yıl önce

Multithreading in Python actually makes sense now!

Karan Jadhav profil fotoğrafı
Karan Jadhav1 yıl önce

As far as I remember, when this was in beta, disabling the GIL made multi-threaded code fast, but it caused single-threaded code to run slow. I'm not sure if that's fixed or will be an issue with this.

Roshan 🇮🇳👨‍💻 profil fotoğrafı
Roshan 🇮🇳👨‍💻1 yıl önce

Small clarification - Multithreading will now work for CPU-bound tasks as well, I/O-related tasks were already able to handle multithreading.

Mohan profil fotoğrafı
Mohan1 yıl önce

@grok couldn't you do parallel code in python for a while since most of the ml libs are written in C??

Rach profil fotoğrafı
Rach1 yıl önce

and you can have really fast backends too(albeit experimental)

Clark Bennet profil fotoğrafı
Clark Bennet1 yıl önce

Python is useful, legit tool for quickly doing one-off scripts that automate mundane shit , are not critical in any way and never leave the house. Out of that role it's just a giant moron magnet. If you see Py MT as a big deal, you are using it wrong.

T. Vuorinen profil fotoğrafı
T. Vuorinen1 yıl önce

Multiprocessing, however, has worked since 2.6.

fatih profil fotoğrafı
fatih1 yıl önce

geçen konuştuğumuz muhabbet, vay anasını. @mertcobanov

JK profil fotoğrafı
JK1 yıl önce

What’s fascinating here is not just the technical leap, but the potential for redefining how Python is used in performance-critical environments. For years, Python has been seen as the “easy” language that trades speed for simplicity. With GIL out of the picture, that narrative starts to change. The question is whether this opens the door to broader adoption in areas traditionally dominated by C++ and Java.

Ajit Pawar profil fotoğrafı
Ajit Pawar1 yıl önce

How does its performance compare with other languages like .NET and Java, which already provide this?

OpenBMB profil fotoğrafı
OpenBMB1 yıl önce

This is indeed a significant milestone for Python! The removal of the Global Interpreter Lock (GIL) option in 3.14 addresses one of Python's long-standing limitations for CPU-bound tasks.

Chemo4707 profil fotoğrafı
Chemo47071 yıl önce

If you want performance, it doesn't make sense to choose Python.

Santonow profil fotoğrafı
Santonow1 yıl önce

No performance benefit for CPU-bound tasks; for IO-bound ones (like making a lot of requests concurrently) threads already provided a lot of performance benefits.

suraj profil fotoğrafı
suraj1 yıl önce

wasnt this available in 3.13 a year ago?

Bill Wallace, PhD profil fotoğrafı
Bill Wallace, PhD1 yıl önce

LOL - could do that in C in 1990s 😂🤣

Maheedhar profil fotoğrafı
Maheedhar1 yıl önce

Python is for asynchronous programming. Removing the GIL requires extra synchronization. Net effect: single-threaded code can be noticeably slower vs. regular CPython.

G profil fotoğrafı
G1 yıl önce

@0sumTX

Qasim Wani profil fotoğrafı
Qasim Wani1 yıl önce

This is objectively false. Asyncio/ThreadPool can be used to achieve concurrency for I/O tasks and parallelism can be achieved for CPU bound tasks via multi-processing. For I/O tasks (file read, network requests) they can be easily made concurrent via asyncio/ThreadPool where as soon as the task is blocked on the event loop, it will run the next task. Even tho the GIL blocks multiple threads from executing at the same time, whenever there's a blocking task in a thread the GIL is unfrozen and moves to the next thread achieving strong concurrency and near parallelism at small to medium scale. This is how I can scrape 10k+ websites in one seconds ;) For CPU bound tasks (math, which is what i suspect the video is doing), you can use ProcessPool to achieve true parallelism by running each task on a different process, where each task uses separate memory with it's own GIL. i suggest you to read:

truth.phd profil fotoğrafı
truth.phd1 yıl önce

Free threading is not a silver bullet; shared state still bites. Split work so threads touch separate data; pass messages, not shared dicts. Pro tip: watch for the t ABI tag; cp314t wheels target free threaded Python, and uv can fetch them. Also, single thread runs may slow a bit; measure, then choose threads or processes.

𝕬𝖑𝖕𝖍𝖆 𝕷𝖊𝖌𝖎𝖔𝖓 🕋 profil fotoğrafı
𝕬𝖑𝖕𝖍𝖆 𝕷𝖊𝖌𝖎𝖔𝖓 🕋1 yıl önce

Python is slow af. It should only be used for scripts not serious code. You’ll have a 100000x speed boost and energy efficiency boost with native code written in c or rust

hilman profil fotoğrafı
hilman1 yıl önce

🤣🤣🤣

Speedy Jalaling profil fotoğrafı
Speedy Jalaling1 yıl önce

I ran the same multi-threaded code I wrote 3 years ago, it ran perfectly well. Same code I had to change three years ago because it wasn’t performing as well as needed.

Behnam profil fotoğrafı
Behnam1 yıl önce

multi threaded but not multi processing

r3333d profil fotoğrafı
r3333d1 yıl önce

You could disable gil in 3.13

sacredgeometry profil fotoğrafı
sacredgeometry1 yıl önce

Woot! Welcome to 1968 🎉

37 profil fotoğrafı
371 yıl önce

It's just as slow though, it's merely parallel.

Sakthi profil fotoğrafı
Sakthi1 yıl önce

Is it faster than spring boot with virtual threads Java 21?

Walker Boh profil fotoğrafı
Walker Boh1 yıl önce

1. Its not enabled by default - you have to choose a custom install. 2. Most packages do not support it yet.

Rohit Gupta profil fotoğrafı
Rohit Gupta1 yıl önce

To know about what other things are in 3.14, please read my article

Saïd Aitmbarek profil fotoğrafı
Saïd Aitmbarek1 yıl önce

finally! ~ took 30y

abuali profil fotoğrafı
abuali1 yıl önce

Interesting. Thank you!

Ayoub B.H profil fotoğrafı
Ayoub B.H1 yıl önce

I deeply tested it last November 2024, and recently again still not completely competing in real-time massive rendering, but it is a good move

choke profil fotoğrafı
choke1 yıl önce

phyton lives in the 60s or what?

Benzer Videolar

🚨 THIS IS ACTUALLY INSANE Python developers are still installing five different tools to manage one project. `pip` for packages. `virtualenv` for environments. `pyenv` for Python versions. `pipx` for CLI tools. `poetry` for project management. uv replaces all of them with one tool. And it’s written in Rust. The headline number: 10–100× faster than pip. But speed isn't even the most interesting part. uv can: → Create and manage Python projects → Resolve dependencies with a universal lockfile → Create virtual environments → Install and switch between Python versions → Run standalone Python scripts with dependencies → Install CLI tools with `uvx` → Compile and sync requirements → Manage Cargo-style workspaces The workflow becomes ridiculously simple: `uv init` → create a project `uv add` → add dependencies `uv run` → run your code `uv lock` → lock dependencies `uv sync` → reproduce the environment And if you're already using pip? You don't have to throw your workflow away. The `uv pip` interface is designed as a drop-in replacement while giving you the speed boost. The other clever bit: uv uses a global cache to deduplicate dependencies and save disk space. So instead of assembling a Python toolchain piece by piece, you get one fast CLI that covers the whole workflow. And unlike a lot of newer developer tools, uv is already considered stable and production-ready. If you work with Python, this is one of those tools you should probably try once. You might not go back. #Python #DevTools #Rust #OpenSource #Programming #AIEngineering

Vikas gupta

40,126 görüntüleme • 1 ay önce

RustGIS is now on PyPI: pip install rustgis RustGIS is a fast, free and open-source GIS in pure Rust for mapping, analyzing and sharing geospatial data. It runs natively on Windows, macOS and Linux, and in your web browser. Your data stays on your machine unless you send it to an AI model you choose, and every action is a command you can script. The new rustgis Python package brings the RustGIS engine into Python and the full RustGIS app into your Jupyter notebook, with no server to run and nothing else to install. What you can do - The engine in-process: open the same data the app opens, run any of RustGIS's commands and geoprocessing tools, style layers and render maps, all from Python. - GeoPandas in and out: turn any layer into a GeoDataFrame, or add a GeoDataFrame as a layer. - The whole app in a notebook cell: shows the ribbon, panes and map right below your code. - Two-way sync: what Python adds or styles appears in the app, and what you pan, edit or add in the app comes back to Python. - Projects that travel: save a .rgis project from Python and open it as it is in the desktop app or the web app. - Runs where you work: JupyterLab, Jupyter Notebook, VS Code and Google Colab, with prebuilt wheels for Windows, macOS and Linux. Get started in three lines: import rustgis m = m Try it out - Open the getting-started notebook in Colab: - PyPI: - Python guide: - Launch the web app: - GitHub: #GIS #Rust #Python #Jupyter #OpenSource #Geospatial

Qiusheng Wu

13,852 görüntüleme • 19 gün önce