Free Threading — Python's way to "goroutines", sort of. I’ve been experimenting with the new python3.14t builds. By combining Free-threading with AsyncIO, you can now: 1. Spawn worker threads (Parallelism). 2. Run an AsyncIO loop inside each (Concurrency). 3. Use queue.Queue as your "Channels" for thread-safe communication. The Result? True parallelism without the memory overhead of multiple processes. I’ve broken down the benchmarks and the "serialization tax" of subinterpreters in my latest write-up. If you're building high-scale backends, this is required reading. Read more: https://lnkd.in/gp3KBR_G #Python #DistributedSystems #Concurrency #Scalability #Performance
Free Threading in Python for Parallelism and Concurrency
More Relevant Posts
-
For years, we accepted the GIL as a tax on Python performance. But with the "No-GIL" movement officially maturing in Python 3.14 and 3.15, we are finally unlocking true multi-core parallelism. It is a massive shift in how we think about CPU-bound tasks. We no longer have to default to multiprocessing and the memory overhead that comes with it just to bypass the lock. Seeing a single Python process actually saturate multiple cores without the "ceremony" of older workarounds feels like a new era for the language. The performance gap with Go or Rust is narrowing where it matters most, making Python an even stronger contender for high-throughput backends. Are you already experimenting with free-threaded builds for your heavy processing, or are you waiting for library support to catch up? #Python315 #PerformanceEngineering #BackendDevelopment #NoGIL #ProgrammingTrends
To view or add a comment, sign in
-
Python is undergoing an important change... Recently, I came across a post about FastAPI mentioning support for free-threading, which led me to reflect on its practical impact. With the removal of the GIL, Python’s concurrency model evolves: - Threads can now run in true parallelism - Improved performance for CPU-bound workloads - New architectural possibilities This raises an important question: When should you use async vs threads? 🧠 A simple way to think about it: - I/O-bound → async - CPU-bound → threads In practice, the most common approach will be combining both: async for I/O and threads for CPU-intensive tasks. This shift reduces the need for multiprocessing and makes Python more competitive in concurrent workloads. I plan to start exploring this model in real-world projects and share the learnings soon. How do you see this impacting the architecture of your systems? #python #freethreaded #fastapi #multiprocessing #concurrency #threads #performance
To view or add a comment, sign in
-
Here’s a tiny Python change that pays off fast. Python tip: use `@dataclass(slots=True)` for high-volume models. It removes per-instance `__dict__`, which usually means lower memory usage and slightly faster attribute access. Great for DTOs, parser outputs, event payloads, and cache objects where shape is fixed. Mini rule: if the object schema is stable, add `slots=True` by default. #Python #Performance #CodeQuality #SoftwareEngineering
To view or add a comment, sign in
-
-
Published pytures on crates.io — a small library that lets Rust Futures and Python Coroutines await each other. Came out of a real need: we have an algorithmic trading system in Rust and wanted to script it with async Python. Both sides are poll-based state machines under the hood, so adapting one to the other turned out to be a clean problem. The tricky part was getting the wakeup semantics right so nothing busy-polls unless necessary. The entire public API is two types. BSD-3-Clause. Github: https://lnkd.in/dFT5HBec crates.io: https://lnkd.in/dzzNAgRW #rust #python #async #opensource
To view or add a comment, sign in
-
STREAMLIT A new Python library that lets you make web-based user interfaces with pure Python. And since I discovered this, it's been my absolute go-to for spinning up simple Python websites. It's extremely useful for data science and AI-related apps: https://streamlit.io/ #WebApps#WebAppDevelopment#AntonGlenbovith#Dashboards#PythonProgramming
To view or add a comment, sign in
-
🚀 #100DaysOfPython – Day 3: Lambda Functions 👉 Lambda = small anonymous function (one line) Example: add = lambda a, b: a + b print(add(2, 3)) # 5 Used commonly with: nums = [1, 2, 3, 4] squared = list(map(lambda x: x*x, nums)) ✨ Short and quick ✨ Useful for simple operations ⚠️ But here’s the catch: If your logic is more than one line → use a normal function. 🔍 My takeaway: Lambdas are great for simple transformations, not for complex logic. Read more: https://lnkd.in/eSSCUfmi #Python #Coding #100DaysOfCode #Developer
To view or add a comment, sign in
-
Type check your Python codebase 15x faster with Pyrefly ⚡ Tools like MyPy and Pyright process files sequentially, so larger codebases lead to longer wait times. Pyrefly, Meta's Rust-based type checker, runs checks in parallel, keeping performance nearly constant as your codebase grows. Key features: • Re-checks only changed modules for faster incremental runs • Automatically infers types for variables and return values On the PyTorch codebase, Pyrefly completes a full check in 2.4 seconds, about 15x faster than Pyright and 20x faster than MyPy. --- 📬 I share 2 practical tips on practical tools for data and AI twice a week on Substack. Subscribe here: https://bit.ly/46fdOPl #Python #TypeChecking #Rust
To view or add a comment, sign in
-
-
semantic winner ≠ policy winner Ran RISWIS Applied on a fresh machine (PowerShell, Python 3.12). Same system. Different query phrasing. → one returns pure semantic ranking → one triggers policy override RISWIS doesn’t force outcomes. It makes ranking decisions visible. can demo from GitHub https://lnkd.in/giw8HXCd
To view or add a comment, sign in
-
-
The #python 3.14 was released with a feature to support developers write better, safer code. While similar to f-strings, there are some key differences. Join us TONIGHT to explore what they are, how they work, who they're for, and how they help. http://pytexas.org/meetup
To view or add a comment, sign in
-
-
Python Logic: Is this Math or Magic?🤔 Day 8 of my Python journey! C++ logic tells me: You can't add words to numbers. Python logic says: Hold my coffee ☕ Check out this snippet: result = True + True + False * True What do you think the print(result) output will be? Drop your guess in the comments! 👇 A) True B) 2 C) 3 D) Error Hint💡: It comes down to how Python stores Booleans as Integers! #Python #LearninginPublic #30DaysOfCode #ProgrammingLogic #Day8
To view or add a comment, sign in
-
Explore content categories
- Career
- Productivity
- Finance
- Soft Skills & Emotional Intelligence
- Project Management
- Education
- Technology
- Leadership
- Ecommerce
- User Experience
- Recruitment & HR
- Customer Experience
- Real Estate
- Marketing
- Sales
- Retail & Merchandising
- Science
- Supply Chain Management
- Future Of Work
- Consulting
- Writing
- Economics
- Artificial Intelligence
- Employee Experience
- Workplace Trends
- Fundraising
- Networking
- Corporate Social Responsibility
- Negotiation
- Communication
- Engineering
- Hospitality & Tourism
- Business Strategy
- Change Management
- Organizational Culture
- Design
- Innovation
- Event Planning
- Training & Development